Topic: APLX Help : Help on APL language : APL Primitives : ⎕ Evaluated input
[ Previous | Next | Contents | Index | APL Home ]

www.microapl.co.uk

Evaluated input


If appears to the right of the symbol or is referenced in some other way, it causes numeric input to be accepted from the keyboard and to be put into the variable named in the assignment. Valid APL expressions can also be entered whilst in input mode, and their results will be returned by ⎕. System commands can also be entered whilst in input mode, and their results will be printed and the ⎕: prompt redisplayed. An empty input in response to input is not accepted, and the prompt is redisplayed.

             PRICE ← 12.50
             QTY ←⎕                  (⎕ causes ⎕: to be displayed as a
       ⎕:                             prompt to the user to type a number.
             50                       Here the user types 50. This is put in
             'VALUE IS ' (PRICE×QTY) QTY and the expression is evaluated)
       VALUE IS 625
             QTY←⎕                   (If the user types any expression
       ⎕:                             yielding a numeric result, this is
             50+50                    accepted.)
             QTY
       100
             QTY←⎕                   (The user types in a vector of numbers)
       ⎕:
             1 2 3 4 5
             QTY
       1 2 3 4 5
             1 2 3+⎕                 (Input is requested and then used in
       ⎕:                             the expression)
             4
       5 6 7

Topic: APLX Help : Help on APL language : APL Primitives : ⎕ Evaluated input
[ Previous | Next | Contents | Index | APL Home ]