Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 07:57 07 Jun 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 : Webmite - Library function

Author Message
Nimue

Guru

Joined: 06/08/2020
Location: United Kingdom
Posts: 411
Posted: 07:52pm 04 Jun 2025
Copy link to clipboard 
Print this post

Hi

(Sorry for two posts in quick succession).

I'm using the library function to store the boiler plate code for the webserver.  Other than being an extra step if/when I need to update it - are there any negative implications in doing so?

So far, all working fine -- just checking I'm not missing something.

N
Entropy is not what it used to be
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4954
Posted: 06:57am 05 Jun 2025
Copy link to clipboard 
Print this post

Hi N,

Just make sure you keep the source code. Changing code in the library is not possible.

Volhout
PicomiteVGA PETSCII ROBOTS
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7681
Posted: 07:47am 05 Jun 2025
Copy link to clipboard 
Print this post

I think LIBRARY SAVE should really be LIBRARY MOVE as there is no access to the code once it has been moved to the Library - it's gone from the editor. During the move it is also crunched, so all unnecessary spaces and all comments are stripped out. As Volhout says, it's important to keep your Library source code!

I seem to remember that, as the Library code is still ASCII, you *can* actually get it back to change things. However, it's awkward and the code is pretty mangled - definitely not recommended.
Mick

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

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2508
Posted: 08:01am 05 Jun 2025
Copy link to clipboard 
Print this post

  Draft Manual said  The LIBRARY contents can be saved to disk using LIBRARY DISK SAVE fname$ and restored using LIBRARY DISK LOAD fname$

The other option is LIBRARY LIST to the terminal then select/copy/paste to a file.
All comments and unnecessary white space are removed. Command and Function names are restored from their tokens so it is still readable.

If you do want comments to be preserved in the Library put them in a string variable.
C$ = "I want this to stay"
C$ = "...and this too."
C$ = "now to recover the memory"
ERASE C$
Edited 2025-06-05 18:17 by phil99
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7681
Posted: 09:57am 05 Jun 2025
Copy link to clipboard 
Print this post

The point in stripping stuff out of the Library code is to save space and speed things up. It would seem a bit counter-productive to create variables to store comments that have no useful purpose. :)  Yes, you can do it, but it's more sensible to keep your editable source.

LIBRARY SAVE literally saves the code, not the editable version. That's already gone by that stage. You have to make sure you save the source *before* using LIBRARY SAVE. I really do think that LIBRARY MOVE makes a lot more sense.

LIBRARY DISK SAVE saves the current Library code to disk, in it's crunched form so it's still not (sensibly) editable.
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.

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