Skip to content

Issue with associative array example #148

Closed
@circular

Description

@circular

I was just learning about associative arrays in SmallBASIC and unfortunately there seems to be an issue with the exmaple:

https://smallbasic.github.io/pages/features.html

tload "/etc/passwd", buffer
dim users
for row in buffer
  split row, ":", fields()
  if (len(fields) > 0) then
    local user
    user.name = fields(0)
    user.passwd = fields(1)
    user.userId = fields(2)
    user.groupId = fields(3)
    ' Line below seems linked to error
    users(user.name) = user
  fi
next row
? users("mail").userId
RTE-ERROR ... Line 11
Expr/RT: Not a number

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions