Topic: APLX Help : Help on APL language : System Functions & Variables : ⎕IO Index Origin
[ Previous | Next | Contents | Index | APL Home ]

www.microapl.co.uk

⎕IO Index Origin


The system variable ⎕IO has a numeric value of 0 or 1 which states whether the origin for counting is 0 or 1. This determines whether the first element in a count is element 0 or element 1. The default is 1. A new value can be assigned. ⎕IO may be localised in a function.

             ⎕IO←1
             ⍳4
       1 2 3 4
             ⎕IO←0
             ⍳4
       0 1 2 3

Operations which involve indexing of arrays ([ ]) are affected by ⎕IO.

A number of functions are affected by ⎕IO:

             ⍳ ? ⍋ ⍒ ⍉ ⊃ ⌷

Functions and operators which use axis specifications are also affected:

             ⌽  ⊖  /  ⌿  \  ⍀  , ↑ ↓ ⊂ ⊃

and finally, the line number returned by ⎕FX if an error occurs is affected by ⎕IO.


Topic: APLX Help : Help on APL language : System Functions & Variables : ⎕IO Index Origin
[ Previous | Next | Contents | Index | APL Home ]