zxbasic icon indicating copy to clipboard operation
zxbasic copied to clipboard

[Bug]: "Code" function behaves inconsistently with constant and non-constant parameter

Open oskostenko opened this issue 6 months ago • 0 comments

Contact Details

No response

Compiler version

v1.18.1

What happened?

print code("a") * 3      ' prints "291"

dim char as string = "a"
print code(char) * 3     ' prints "35" (which is 291 truncated to byte size)

I'd expect that in both cases the result is the same.

Error and Warning messages


Code of Conduct

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

oskostenko avatar Jul 20 '25 19:07 oskostenko