Slide 54 of 80
Notes:
- CI does not formally support arrays, but this simple convention works well.
- Max number of CI variables depends on the length of the variable name and the size of its value.
- In 7.0 an approximate maximum number of user variables is 10,800 unique variables. This is derived as follows:
deletevar @ setvar z 0 while true do setvar z z+1 setvar zz 0 while setvar(zz,zz+1) <= 26 do setvar ![chr(ord(“A”)+zz-1)]!z true # A1, B1, C1… Z1 followed by endwhile # A2, B2, C2…Z2 etc. endwhileExecuting this script fills the variable table, evident by the CI error reported below:
Symbol table full: addition failed. To continue, delete some variables, or start a new session. (CIERR 8122)
:calc ((z-1)*26)+zz+2 # + 2 local vars: z, zz10792, $2A2*, %25050
- An approximate more typical maximum number of user variables on 7.0 is: 8,340 unique variables, derived as: deletevar @ setvar z 0 setvar name ‘!![rpt(chr((hpcpumsecs mod 26)+ord("A")),(hpcpumsecs mod 14)+2)]’ # var names begin w/ A-Z, from 2..15 chars long setvar value ‘!![rpt(chr((hpcpumsecs mod 26)+ord("A")),(hpcpumsecs mod 60)+1)]’ # var values begin w/ A-Z, from 1 to 60 chars long while true do setvar !name![setvar(z,z+1)] “!value” endwhile:calc z+2 # + 2 for name and value