Amiga World Official AmigaDOS 2 Companion - eBook-ENG

Page 312

294

AmigaWorld Official AmigaDOS 2 Companion

Figure 10-5 Escape Sequence Example

This sequence skips two lines, sets the type style to bold italic inverse, prints the message "Hello World," resets the type to plain text, and skips two more lines, all with one command (see text).

The PROMPT/A argument is a character string that prompts the user for input. The Ask command only accepts Y and N for input; it sets a return code of 5 if you enter Y, and 0 if you enter N or press the Return key. To test for input, you check the return code. For example, ASK "Do You wish to Exit? " IF WARN

QUITO ENDIF

If you enter a Y in response to the prompt, the If condition is true and you execute the Quit command. Otherwise, you skip over the Quit command. Another method of getting input for a script is described with the Skip com mand, in conjunction with labels.


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.