sannybuilder/dev

indexing local string vars is impossible

x87 opened this issue · 1 comments

x87 commented

this works:

s$var[0] = '0'    
s$var[1] = '1' 

this doesn't:

0@s[0] = '0'  // error Invalid local variable name 0@s.

As an implication custom string variables also get wrong indexes:

string x[3]

x[0] = '0' // 0@ - ok
x[1] = '1' // 1@ - wrong
x[2] = '0' // 2@ - wrong
x87 commented

Test case:

{$CLEO .cs}

string s[3]
longstring v[3]
int y = 18 // 3*2 + 3*4
                      
0@s[0] = '0'
0@s[1] = '2'
0@s[2] = '4'

s[0] = '0'   
s[1] = '2'   
s[2] = '4'   


v[0] = "6"   
v[1] = "10"   
v[2] = "14" 

s$var[0] = '4'    
s$var[1] = '6'
s$var[2] = '8'                      

v$var[0] = "4"    
v$var[1] = "8"
v$var[2] = "12"