Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
60
Task/Arrays/Action-/arrays.action
Normal file
60
Task/Arrays/Action-/arrays.action
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
PROC Main()
|
||||
BYTE i
|
||||
|
||||
;array storing 4 INT items with initialized values
|
||||
;negative values must be written as 16-bit unsigned numbers
|
||||
INT ARRAY a=[3 5 71 65535]
|
||||
|
||||
;array storing 4 CARD items whithout initialization of values
|
||||
CARD ARRAY b(3)
|
||||
|
||||
;array of BYTE items without allocation,
|
||||
;it may be used as an pointer for another array
|
||||
BYTE ARRAY c
|
||||
|
||||
;array of 1+7 CHAR items or a string
|
||||
;the first item stores length of the string
|
||||
CHAR ARRAY s="abcde"
|
||||
|
||||
PrintE("Array with initialized values:")
|
||||
FOR i=0 TO 3
|
||||
DO
|
||||
PrintF("a(%I)=%I ",i,a(i))
|
||||
OD
|
||||
PutE() PutE()
|
||||
|
||||
PrintE("Array before initialization of items:")
|
||||
FOR i=0 TO 3
|
||||
DO
|
||||
PrintF("b(%I)=%B ",i,b(i))
|
||||
OD
|
||||
PutE() PutE()
|
||||
|
||||
FOR i=0 TO 3
|
||||
DO
|
||||
b(i)=100+i
|
||||
OD
|
||||
PrintE("After initialization:")
|
||||
FOR i=0 TO 3
|
||||
DO
|
||||
PrintF("b(%I)=%B ",i,b(i))
|
||||
OD
|
||||
PutE() PutE()
|
||||
|
||||
PrintE("Array of chars. The first item stores the length of string:")
|
||||
FOR i=0 TO s(0)
|
||||
DO
|
||||
PrintF("s(%B)='%C ",i,s(i))
|
||||
OD
|
||||
PutE() PutE()
|
||||
|
||||
PrintE("As the string:")
|
||||
PrintF("s=""%S""%E%E",s)
|
||||
|
||||
c=s
|
||||
PrintE("Unallocated array as a pointer to another array. In this case c=s:")
|
||||
FOR i=0 TO s(0)
|
||||
DO
|
||||
PrintF("c(%B)=%B ",i,c(i))
|
||||
OD
|
||||
RETURN
|
||||
Loading…
Add table
Add a link
Reference in a new issue