User Input

MSW Logo is a Graphical User Interface ("GUI") programming environment. If you want user input you MUST use the Windows GUI to obtain it. There is no simple "command line" input equivalent to Pascal's "readln(variableName)" statement.

There are several ways of extracting user input. One of them involves using the questionbox function as indicated below ...

make "number1 first questionbox [UserInput][Enter the first number]

When you call this line in MSW Logo the user input box appears:

"number1" is the variable name, "first" tells MSW Logo to extract the first item in the list. The text in the first set of square brackets is the label for the box and the text in the second set of square brackets appears as a prompt.

The user enters a number in the box and then presses the Enter key, or clicks the OK button. The value of the variable "number1" will then be equal to the first number entered.

NOTE: If the user enters several numbers, only the first will be assigned to the variable.

<- Back -Menu- Next ->