Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 05:40 13 Nov 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 : Comments access from MMBasic

Author Message
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1116
Posted: 09:36am 09 Aug 2019
Copy link to clipboard 
Print this post

Anyone know of any way to access comments that are embedded inside an MMBasic program from a running MMBasic program?

panky
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10573
Posted: 11:28am 09 Aug 2019
Copy link to clipboard 
Print this post

'This is a comment
do
j= peek(progmem,i)
if j=39 then s=1
if j=0 then
if s then
s=0
print ""
endif
j= peek(progmem,i+1) 'comment this line
if j=0 then exit do
endif
if s then print chr$(j);
i=i+1
loop
'This is another comment
print "Thats all folks"

Edited 2019-08-09 21:42 by matherp
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2171
Posted: 01:47pm 09 Aug 2019
Copy link to clipboard 
Print this post

without the faf, is it something you can put in DATA statements? so instead of


' this is a comment

you could have


DATA "this is a comment"

and then access it without the cryptic (albeit interesting) work that Peter just highlighted, with simple RESTORE and READ.

This also make those comments immune to CRUNCHing - which might be a problem if you have code that is expecting to have something useful in the comment.
Edited 2019-08-09 23:50 by CaptainBoing
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1116
Posted: 10:53pm 10 Aug 2019
Copy link to clipboard 
Print this post

@matherp and captainboing,

Many thanks to both - exactly what I was looking for,
Regards,
Panky.
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
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