sannybuilder / dev

Sanny Builder Bug Tracker and Roadmap development
https://sannybuilder.com
49 stars 0 forks source link

indexing local string vars is impossible #265

Closed x87 closed 1 year ago

x87 commented 1 year ago

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 1 year ago

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"