home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Press 1997 July
/
Sezamfile97_1.iso
/
msdos
/
misc
/
sm30a.a03
/
SYMBMATH.H08
< prev
next >
Wrap
Text File
|
1993-11-07
|
2KB
|
40 lines
3.1.8 Arrays and Array Index
Arrays are the same as arrays in such language as PASCAL and
FORTRAN. But you can use arrays without declaring arrays, unlike in PASCAL
and FORTRAN.
e.g.
a[1]:=1
a[2]:=4
The array index is the index for n-th element in an array. e.g.
a[2] indicates the second element in the array a.
3.1.9 Lists and List Index
Lists are similar to lists in such language as PROLOG.
[a, b, c] is a list.
[a, b, [c1, c2]] is a list of lists.
The list index is the index for n-th element in a list. e.g.
b[2] indicates the second element in the list b.
The built-in list index is last[number]. The name of last
output list is last, e.g. last[1] is the first element in the
last output list.
3.1.10 Strings
A string is a sequence of characters between two quotation marks.
e.g. "1234567890". Note that 1234 is number but "1234" is string. The
number can be calculated and only has 11 of max digits, while string
cannot be calculated and has 64000 of max characters long.
Strings can be storeed in variables, concatenated, removed,
lengthed, and converted to numbers if possible.
e.g.
IN: p := "abc" # "abc" is stored in variable p
OUT: p := "abc"
IN: concat("s","t") # concatenate "s" and "t"
OUT: st
IN: remove("b" from "ab") # remove "b" from "ab"
OUT: "a"
IN: length("abc") # count length of "abc"
OUT: 3
IN: number("123") # convert string "123" into number 123
OUT: 123