EV_startApp Function (ROM Call 0xD4)

events.h

void EV_startApp (HANDLE TaskID, unsigned short StartType);

Starts an application from any state.

EV_startApp is dedicated to "start the application". It changes current application to TaskID and sends a sequence of messages to it (how they will be interpreted depends on the concrete application), so this command may be used for changing the current application.

It is not likely that following information will be very useful for you (except if you are an expert who wants to make a new high perfomance flash application), but anyway here is the pseudo-code which describes what exactly EV_startApp does:

if TaskID is equal to the current application
  if StartType is AP_START_CURRENT
    send CM_START_CURRENT to the current application
  else {change task}
    send CM_UNFOCUS, CM_DEACTIVATE and CM_ENDTASK to the current application
    call EV_startTask, passing StartTask to it
    send CM_ACTIVATE and CM_FOCUS to the current application
  endif
else {new application}
  send CM_UNFOCUS and CM_DEACTIVATE to the current application
  if TaskID is equal to the application on the other side
   and if the calculator is in "two-graph" mode
   or TaskID is not "Graph", "Window Editor", "Table" nor "Y= Editor"
    set current application to TaskID
    invert current side
    call EV_notifySwitchGraph
    if StartType is not AP_START_CURRENT
      send CM_ENDTASK to the new application
      call EV_startTask, passing StartTask to it
    endif
  else
    send CM_ENDTASK to the current application
    set current application to TaskID
    call EV_startTask, passing StartTask to it
  endif
  send CM_ACTIVATE and CM_FOCUS to the new application
endif
Under normal circumstances, you should start another application with StartType set to AP_START_CURRENT.

Note: Task ID numbers are inconsistent between AMS versions (see EV_getAppID for more info). So, if you, for example, want to start the "Numeric Solver" application, the AMS-independent way to do this is
EV_startApp (EV_getAppID ("TIINSLVR"), AP_START_CURRENT);
Also, some common applications (like "Graph", "Table" or "Home screen") may be started safely using some commands from bascmd.h header file.


Uses: EV_notifySwitchGraph, EV_sendEvent, EV_startTask, MO_isMultigraphTask, EV_appA, EV_appB, EV_appSide, EV_currentApp
Used by: EV_defaultHandler, EV_switch, cmd_disp, cmd_disphome, cmd_disptbl, cmd_input, cmd_inputstr, cmd_output, cmd_pause, cmd_prompt, cmd_table, ERD_process, HomeExecute, EV_quit, GraphActivate, ROM Call 0x455