Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 15:31 27 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : MMBasic V4.5 editor problem with .DAT files

Author Message
slhd
Newbie

Joined: 10/10/2023
Location: Germany
Posts: 2
Posted: 05:44am 12 Oct 2023
Copy link to clipboard 
Print this post

Hello,

my name is Stephan from Germany - I am using MMBasic V4.5 on an UBW32.
I have a problem with editing stored data as .DAT files through the screen editor.

I am generating a .DAT file with open for output and print command.
For a graphic program I need to store several lines of two numerical numbers (eg 345, 178).

Reading the .DAT file works without any problem, so far I do not open the file with the screen editor.

Example :

- generate a .DAT file with 25 lines of same data (eg 100, 120).
- file size seems correct
- open with editor only 1 line with 100,120 is visible instead of 25
- open and read the data still works
- but when you save after using the editor all other 24 lines are away
- file size is of course very small

It seems the editor ist erasing all lines which begin with the same number.
Guess it "think" that these are line numbers, so it over write double numbers.

Checking the .DAT file with a PC shows all lines so long I did not save it after opened with the editor.

To avoid this I put a string as first data (eg D, 345, 178), so all lines are visible there.
But I don`t want to waste memory.

Well, is this a problem with my UBW32 or do you have the same with a Maximite Color?

Cheers,
Stephan

ps: please excuse my english if it sounds a bit strange
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3802
Posted: 06:34am 12 Oct 2023
Copy link to clipboard 
Print this post

The editor is for use with Basic programs only.

So, yes, it will be confused by what look like line numbers.

John
 
slhd
Newbie

Joined: 10/10/2023
Location: Germany
Posts: 2
Posted: 04:38am 13 Oct 2023
Copy link to clipboard 
Print this post

Thanks, so I may add a upcounting line number as part of the data instead of a string.
Or is there any other way to void this problem.
Stephan
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6798
Posted: 07:00am 13 Oct 2023
Copy link to clipboard 
Print this post

To be honest, I'd simply edit the DAT file in an external editor - or write a simple editor in MMBasic. You know the file format and you probably know how many values there are so you could just read them into an array, edit it and re-write the array.

Welcome to the forum, by the way. :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024