| cmd_inputstr | Function (ROM Call 0x357)

AMS 1.01 or higher | bascmd.h

void cmd_inputstr (ESI PromptAndVar);

Executes TI-Basic 'InputStr' command.

If PromptAndVar points to a string item (more precise, to its STR_TAG), cmd_inputstr first displays the current contents of the TI-Basic Program I/O Screen window, pauses the program, displays the prompt string pointed to by PromptAndVar on the Program I/O Screen, waits for the user to enter a response, and stores the response in a TI-Basic variable whose name is given on the expression stack just below the expression pointed to by PromptAndVar. This is illustated in the following example, which stores the user's name in a TI-Basic variable named "x":

    push_quantum (VAR_X_TAG);
    push_zstr ("Enter your name:");
    cmd_inputstr (top_estack);

If PromptAndVar points directly to a variable tag, "?" is displayed as a prompt.
Note: cmd_inputstr is not the recommended way for inputing data from the keyboard into the program. It is limited to the TI-Basic Program I/O Screen window, and it stores the result in TI-Basic variables, which is not so useful in C programs (i.e. you need to import the value of a TI-Basic variable into the program, which is not so straightforward). See the keyboard input section of the FAQ list for explanation of much better ways to enter data from the keyboard.

Uses: ER_catch, ER_success, ER_throwVar, ERD_dialog, next_expression_index, NG_tokenize, push_quantum, top_estack, EV_captureEvents, EV_eventLoop, EV_paintWindows, EV_setFKeyState, EV_startApp, ScrToHome, ScrToWin, strlen, TE_close, TE_focus, TE_isBlank, TE_open, TE_reopen, TE_select, TE_shrinkWrap, TE_unfocus, EV_currentApp, EV_quit, NG_control, push_simplify, VarStore, WinActivate, WinBackupToScr, WinChar, WinClr, WinDeactivate, WinFill, WinHide, WinScrollV, WinStrXY, WinWidth, _ds16u16, _du32u32, ROM Call 0x455, ROM Call 0x471, ROM Call 0x5CA