Large 50g program example
|
06-19-2015, 01:02 PM
Post: #7
|
|||
|
|||
RE: Large 50g program example
(06-19-2015 09:50 AM)Tugdual Wrote: Very instructive. So the idea is really to split the code in as many variables as functions needed. This seems to confirm the idea that the program being a set of variables all in the same directory, the directory itself becomes the program... You are correct, a variable is also a function and a RPL command. Giving proper names to subroutines is extremely important for code readability, especially in RPL which is not so friendly to the eyes, so even for not-so-large projects it's a good idea to use several named variables/commands. The way I always organize my code is one directory per program. The directory contains the source code in the form name.txt (as many as needed), which is then compiled into the 'name' variable. This way you get to keep the commented source code. When it's time for release, simply copy the directory, remove all .txt variables and make a library out of it. And, using one directory per program is also helpful for easy backups. Just throw the following code inside a directory, and will recreate the directory on the SD card, with one file per variable (doesn't do recursive directories, though): Code:
I always use the same name for the backup program: SDBACK, and I make sure it never conflicts with the actual source code. The backup program gets backed up too, but that doesn't bother me. Claudio |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)