![]() |
Forum Index : Microcontroller and PC projects : CMM2: Peeking a scalar variable, what's going on here?
Author | Message | ||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4311 |
Hi folks, I suspect I'm being an idiot, but why is this not working: > list "foo.bas" Option Base 0 Option Explicit On Option Default None Dim a%(1) a%(0) = &hAABBCCDD Print Hex$(Peek(Var a%(), 0)) Dim a_addr% = Peek(VarAddr a%()) Print Hex$(a_addr%) Print Hex$(Peek(Byte a_addr%)) Dim b% b% = &hAABBCCDD Print Hex$(Peek(Var b%, 0)) Dim b_addr% = Peek(VarAddr b%) Print Hex$(b_addr%) Print Hex$(Peek(Byte b_addr%)) > run "foo.bas" DD 3003FF00 DD DD 3800E178 Error in line 19: Address a_addr% is obviously the address of the storage for the first element of a%(), but what is b_addr% and why can't it be PEEKed ? Best wishes, Tom Edited 2021-05-16 02:10 by thwill MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
jirsoft![]() Guru ![]() Joined: 18/09/2020 Location: Czech RepublicPosts: 533 |
Hi Tom, it's working for me. Instead of your error, I got DD... Jiri Napoleon Commander and SimplEd for CMM2 (GitHub), CMM2.fun |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4311 |
That's what I had expected. What firmware version are you running? Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10315 |
Fixed in b33 just posted |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4311 |
Thank you. MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |