Dynamically changing a list in a library
|
07-21-2021, 01:24 AM
Post: #2
|
|||
|
|||
RE: Dynamically changing a list in a library
(07-20-2021 08:36 PM)cahlucas Wrote: Hi all, Is there a reason to not use a user variable to store the data that you anticipate would change? While it is possible to do in a library, it is not a simple task. Libraries are stored with a CRC at the end. You would have to create a copy of your library, compute the difference in size of the existing list and new list, "punch a hole" in your copied library large enough to insert the new list, recompute offsets (possibly), recompute the CRC, and then detach the old library, store the new library, and either attach the modified library (or force a warmstart). And your code would have to be in assembly. If you store your list as the very last object in your library, then recalculating the offsets would be trivial. However, if you have several such lists, then it can be a bit cumbersome. Then there is the memory cost during the moment two copies of your library exists (the old one and the new one). There is also the issue of detaching a library whose code is running in memory. To get around it, you would need to copy your assembly code to memory as a new object and run it from there to avoid any reference conflicts when detaching. So while possible, it seems rather silly when a simple user variable seems like more than sufficient. If you don't want users accessing your list, you can use the Library Data object format. A good resource would be James Donnelly's An Introduction to HP48 System RPL and Assembly Language Programming (free PDF on hpcalc.org) Graph 3D | QPI | SolveSys |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Dynamically changing a list in a library - cahlucas - 07-20-2021, 08:36 PM
RE: Dynamically changing a list in a library - Han - 07-21-2021 01:24 AM
|
User(s) browsing this thread: 1 Guest(s)