Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 07:07 02 Aug 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 : feature request for library

Author Message
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5091
Posted: 10:54am 29 May 2018
Copy link to clipboard 
Print this post

Dear Geoff,

I tried to use the library save command to add a set of defines (CONST x=y) type to MMBASIC. These become available in a program. But they are not available from the commandline (terminal)...only when running a program.

Is there a way (or work around) making them available in the commandline also.

This refers to my Arduino UNO project running MMbasic from an MX170.

I would like the Arduino pins translated to MX170 pins.

i.e.
CONST D13 = 24
CONST A0 = 4
etc....

PicomiteVGA PETSCII ROBOTS
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 10:58am 29 May 2018
Copy link to clipboard 
Print this post

I don't THINK so. This is a 'Gotcha!' that I tripped on too, when I wanted to save a couple of strings and variables in the library. They are available as soon as you type RUN, but not before then. I guess that makes sense when you think about it, as code in the library is supposed to run before the main code at runtime, to setup specific things first, so I guess you have to initialise a run command to start that process in the first place.

I think you want the variables etc to show up as soon as you power-up the MM, and if OPTION AUTORUN has not been enabled(set to ON), then this simply won't happen.

I might be wrong, but I do remember having the exact same issue myself when I was playing with the library and was new to it.
Smoke makes things work. When the smoke gets out, it stops!
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 11:25am 29 May 2018
Copy link to clipboard 
Print this post

You could add a line at the top with
[code]

END
' rest of the code (if there is any)
[/code]

You can then RUN it and get back into the prompt. All variables should then be available for use.


If you already have some code type CONTINUE to continue after the END statement.
Easy way to check your library functions.


Microblocks. Build with logic.
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 11:28am 29 May 2018
Copy link to clipboard 
Print this post

Brilliant idea, MB.
Smoke makes things work. When the smoke gets out, it stops!
 
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