Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tape save/load of arrays fails to compile #651

Open
SimonGreenaway opened this issue Mar 28, 2023 · 1 comment
Open

Tape save/load of arrays fails to compile #651

SimonGreenaway opened this issue Mar 28, 2023 · 1 comment
Labels

Comments

@SimonGreenaway
Copy link

This:

DIM s(16)
SAVE "test" DATA s

Fails to compile with:

test.bas:2: error: Syntax Error. Unexpected token 's' <ARRAY_ID>

Tried with and without brackets, different datatypes and same error. Syntax ok according to wiki (!).
Save "test" DATA does compile and presumable saves all data?

@boriel
Copy link
Collaborator

boriel commented Sep 1, 2023

Hi,

Unfortunately, SAVE "xxx" DATA s for arrays is no longer supported and it's technically almost impossible to implement it for arrays of strings. This is because arrays of strings are very dynamic and not stored in a continuous region of memory like in Sinclair BASIC. So this feature will be removed. Only SAVE "test" DATA (to save al the program state) will be supported.

That said, it's possible to SAVE an array of numbers:

SAVE "test" CODE @s(0), 16 * 5

In this case 16 = Number of elements of the array, 5 = number of bytes of each element (element size). But it won't work for strings.

@boriel boriel added the wontfix label Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants