APLX Help : Help on APL language : APL Fundamentals : Specification
|
|
![]() |
Specification (Assignment) |
The symbol NUM← 24 (scalar 24 is assigned to NUM) DESCRN←'ITEM 241A' (simple character vector) PRICES← 2.34 9.30 12 60.38 (numeric vector is assigned to PRICES) DATA←1 'A' 2 'D' (mixed vector assigned to DATA) When entering character data, care must be exercised if the quote character is to be included in the data. As stated above, adjacent quote marks are evaluated as indicating the quote character in the data. A vector containing only characters can be entered in one of two ways ALF←'A' 'B' 'C' 'D' (data is a set of characters) ALF ABCD ALF←'ABCD' (alternative method of entry) ALF ABCD ALF←'A''B''C''D' (no space between characters) ALF A'B'C'D The right argument to COST←110-67 (The result of evaluating an COST expression is assigned to 43 COST) PROFIT←(PRICE←COST×1.2)-COST←100 PROFIT (right to left execution ensures 20 that the value assigned to COST is used in the expression inside parentheses.) Variables which are either scalars or vectors can be entered directly, as shown above. Matrices or higher dimensional arrays must be established or entered via functions (see for example TAB←2 3⍴⍳6 (The numbers 1 - 6 are arranged as 2 rows of 3 columns and are assigned to TAB) |
|
APLX Help : Help on APL language : APL Fundamentals : Specification
|
Copyright © 1996-2010 MicroAPL Ltd