Xylem STORM 3 Basic Programming manual Manual de usuario Pagina 12

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 48
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 11
COMMANDS AND FUNCTIONS
10
Single-dimensional array:
ARRAY myArray(5)
FOR i = 1 TO 5
myArray(i) = i * 2 REM Duplicate the numbers value inside the array
NEXT i
REM myArray(i) now contains values 2 4 6 8 10
Multi-dimensional array:
ARRAY myArray$(3,7) REM 2-dimensional string array (3 rows, 7 columns)
FOR i = 1 TO 3
FOR j = 1 TO 7
myArray$(i,j) = str$(i * j) REM str$ converts a number to a string
NEXT j
NEXT i
REM myArray$(i,j) now contains values 1 2 3 4 5 6 7
2 4 6 8 10 12 14
3 6 9 12 15 18 21
Returns the given array’s number of dimensions.
ARRAY arr(10)
var = ARRAYDIM(arr()) REM sets var to 1 as arr is one-dimensional
ARRAY myArr(2,4,4)
var = ARRAYDIM(myArr()) REM sets var to 3 as myArr is three-dimensional
ARRAYDIM (array)
Returns the given array’s dimension’s size, where array species the array and number species the
dimension. The last parameter is optional and defaults to the first dimension if not specified.
ARRAY myArray(10)
var = ARRAYSIZE(myArray()) REM sets var to10
ARRAY myArr$(2,4)
var = ARRAYSIZE(myArr$(), 2) REM sets var to4
ARRAYSIZE (array, number)
Returns the rst characters ASCII numerical representation. CHR$( ), converting a numerical value
to the ASCII character, is the opposite function of ASC( ).
var = ASC(“A”) REM sets var to 65
var$ = CHR$(65) REM sets var$ toA
ASC (string)
Vista de pagina 11
1 2 ... 7 8 9 10 11 12 13 14 15 16 17 ... 47 48

Comentarios a estos manuales

Sin comentarios