| EV_getAppID | Function* (tigcc.a)

events.h

short EV_getAppID (const char *TaskName);

Finds a task ID number for an application.

EV_getAppID returns a task ID number for the task/application whose internal name is TaskName, or returns -1 if the application is not found. Each application (including both built-in applications and external Flash applications) has a unique internal name (max. 8 characters). This function is introduced for compatibility with all AMS versions, because task ID numbers are inconsistent between AMS versions. On AMS 1.xx, built-in flash applications have fixed ID numbers attached to them, but on AMS 2.xx the task ID is simply the handle of the application control block (this is why it is quite hard to add flash applications on AMS 1.xx). So, always use EV_getAppID to determine the task ID number for an application. Internal names of built-in applications are given in the following table:

Application name | Internal name
Home screen | TIHOME
Y=Editor | TIEQUED
Window Editor | TIWINDED
Graph | TIGRAPH
Table | TITABLED
Data/Matrix Editor | TIDMED
Program Editor | TIPRGMED
Text Editor | TITEXTED
Numeric Solver | TIINSLVR
Self Test | TISLFTST

Note: Although this function was not officially introduced before AMS 2.xx, it is implemented here to work even on AMS 1.xx! However, there is one difference between this function, and the function with the same name in Flash Studio SDK. This implementation of EV_getAppID returns -1 if the application is not found, but EV_getAppID from Flash Studio SDK returns zero under the same conditions. The convention used in Flash Studio is not consistent with the fact that the "Home screen" application has the ID number 0 on AMS 1.xx. That's why the value for "not found" is slightly changed in this implementation.

Uses: strcmp, TIOS_EV_getAppID