Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 21:06 12 Jul 2025 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 : Help with binary I/O

Author Message
William Leue
Guru

Joined: 03/07/2020
Location: United States
Posts: 405
Posted: 05:44pm 24 Dec 2024
Copy link to clipboard 
Print this post

I thought I knew how to do binary IO, but I guess not.

This simple program:


option default integer
option base 1

const BLEN = 10
const DSIZE = BLEN*64

dim b(BLEN) = (0, 1, 2, 3, 4, 5, 6,7 ,8 ,9)
save data "bfile.bin" peek(VARADDR, b()), DSIZE
end


..dies with 'address error'.

I am sure many of you can and will point out the noob error.
Thanks!
-Bill
 
William Leue
Guru

Joined: 03/07/2020
Location: United States
Posts: 405
Posted: 06:08pm 24 Dec 2024
Copy link to clipboard 
Print this post

I should have added that this is run on a CMM2 Gen2 with MMBASIC v 5.07
-Bill
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10244
Posted: 06:22pm 24 Dec 2024
Copy link to clipboard 
Print this post

I think you have 3 errors
1: no comma between the filename and the address
2: comma in the peek function which shouldn't be there
3: you are saving 8* too much data - try BLEN*8
 
William Leue
Guru

Joined: 03/07/2020
Location: United States
Posts: 405
Posted: 07:22pm 24 Dec 2024
Copy link to clipboard 
Print this post

LOL, thanks, Peter! Actually, the real code does have the comma; I just mis-typed it into the forum. The value 64 is me not thinking straight!

-Bill
 
Print this page


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

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025