Skip to content

indexing local string vars is impossible #265

Closed

Description

@x87

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

Activity

  1. added
    type:bug
    priority:p2
    on Sep 16, 2023
  2. added this to the v3.9.1 milestone on Sep 16, 2023
  3. x87 commented on Sep 17, 2023

    @x87
    CollaboratorAuthor

    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"
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:p2scope:compilertype:bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions