Skip to content

Writing Array fails #33

@kscheff

Description

@kscheff

Hello,

I understand that this repro is kind of "dead" since Tim has left the project. However this is the only place to "hope" for exchange of experience... maybe someone is reading here.

Writing an array to a file works, however after the write command the execution stalls.
Here is my program list

10 OPEN 0, READ "A"
15 FOR I = 1 TO 10
20  READ #0, B
30  PRINT I,",",B
40 NEXT I
60 RETURN 
100 OPEN 0, TRUNCATE "A"
110 DIM U(10)
120 WRITE #0, U
140 CLOSE 0
150 RETURN 

goto 100
Bad expression
>> 140 CLOSE 0

I can read the file successfully by walking to its elements via:

run
1,0
2,0
3,0
4,0
5,0
6,0
7,0
8,0
9,0
10,0
OK

The issue I am fighting is that I wanted to implement an IoT data logger for solar cells mounted on the camping car. Therefore I need a way to store and access some historic values. Doing by writing single vars wastes a lot of memory, e.g. each var occupies 8 bytes (examine the reported memory). So I was looking to write an array instead. It looks like that each array element consumes 1 byte.

I have tried to write different array sizes since I suspected an alignment requirements, but this fails, too. I tried array sizes of 1, 2, 3, 4, 5, 8, 16. Also I checked different file name "A" or "F".

Is there anybody out there that have successfully used these functions?

Thanks
Kai

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions