Post Reply 
Comments in DM32 program listings
06-05-2023, 09:24 PM
Post: #1
Comments in DM32 program listings
The DM32 documentation doesn't mention it yet, but comments can be included within program listings in a way very similar to HP's RPL program comments. The comments can only exist in the "source code", created on a computer as a plain text file.

In brief, everything in a program line after (and including) a "#" character is considered to be a comment, and is automatically deleted when the program is loaded into RAM.

EXAMPLE: Suppose that the following is the program section of a state file:

Code:
# PROGRAM
PTR: 2
PGM
  LBL A # program line 1
  STO X # program line 2
  # comments occupy ZERO memory space
  # comment lines are not loaded at all
  STO Y # program line 3 (not 5)
PGMEND

When loaded into RAM from flash memory, this becomes the following program:

Code:
A01 LBL A
A02 STO X
A03 STO Y

Note: Unlike in RPL, there is no way to turn off comment mode within a program line. For example, EQN 1 + 2 # + 3 # + 4
is loaded into program memory as the equation 1+2, not 1+2+4. Everything between the first "#" and the end of the line is discarded.

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
06-11-2023, 05:27 AM
Post: #2
RE: Comments in DM32 program listings
Thank you for discovering this.
I don't possess one yet, so I lack knowledge.
If stored program is brought back to RAM, comments are lost.
But comments take no memory.
If they do not exist to memory, there is nothing to store.
Then they should be assigned memory, to be saved.
Perhaps SM can work on this in an update.

Regards - RR
Find all posts by this user
Quote this message in a reply
06-11-2023, 12:32 PM
Post: #3
RE: Comments in DM32 program listings
(06-11-2023 05:27 AM)Rolief_Rechner Wrote:  Thank you for discovering this.
I don't possess one yet, so I lack knowledge.
If stored program is brought back to RAM, comments are lost.
But comments take no memory.
If they do not exist to memory, there is nothing to store.
Then they should be assigned memory, to be saved.
Perhaps SM can work on this in an update.

Regards - RR

Just in case I was not clear, the comments are saved, in the "state" file, which is stored in the DM32's flash memory. When that state file is loaded into RAM, the comments are stripped away, because they are not needed there. But they remain intact in the state file, where programmers can read them on their PC's. Bottom line: the comments are not lost, but they take no RAM space... a win/win situation.

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
06-11-2023, 12:40 PM
Post: #4
RE: Comments in DM32 program listings
(06-11-2023 12:32 PM)Joe Horn Wrote:  
(06-11-2023 05:27 AM)Rolief_Rechner Wrote:  Thank you for discovering this.
I don't possess one yet, so I lack knowledge.
If stored program is brought back to RAM, comments are lost.
But comments take no memory.
If they do not exist to memory, there is nothing to store.
Then they should be assigned memory, to be saved.
Perhaps SM can work on this in an update.

Regards - RR

Just in case I was not clear, the comments are saved, in the "state" file, which is stored in the DM32's flash memory. When that state file is loaded into RAM, the comments are stripped away, because they are not needed there. But they remain intact in the state file, where programmers can read them on their PC's. Bottom line: the comments are not lost, but they take no RAM space... a win/win situation.

One small point of clarification - if you make any changes to the State File, and save the changed file, all comments would be lost in that copy, but of course you still have the original file with comments intact on your PC where it was created.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)