Skip to content

[Bug]: Cannot pass array element by reference #994

@oskostenko

Description

@oskostenko

Contact Details

No response

Compiler version

v1.18.1

What happened?

This code won't compile:

FUNCTION plusOne(ByRef a As Ubyte) As UByte
  LET a = a + 1
  RETURN a
END FUNCTION

DIM myArray(5) as Ubyte

PRINT plusOne(myArray(3)) : REM Ok. Will increase myArray(3) by 1 and print the result

The code was taken from the docs (irrelevant parts removed).

Error and Warning messages

byref.bas:8: error: Expected a variable name, not an expression (parameter By Reference)

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions