The Museum of HP Calculators

HP Forum Archive 15

[ Return to Index | Top of Index ]

How to print a program from a 28C ?
Message #1 Posted by marais on 16 May 2005, 4:07 p.m.

I'm sorry gentlement, but all of a sudden my 28C needed to be programmed, and now I don't know how to print out the program to the IR printer. I knew the procedure 15 yrs ago, but I forgot. Anybody know the right key?

      
Re: How to print a program from a 28C ?
Message #2 Posted by Vieira, Luiz C. (Brazil) on 16 May 2005, 4:17 p.m.,
in response to message #1 by marais

Hi, Marais;

remember that in RPL-based calculators, a program is only another object stored in memory, so you can do that in two ways:

1 - put the program in stack level 1 (a single RCL will do, though) and execute [PR1] (print stack level 1 contents); or
2 - put the name of the variable that contain the program in stack level 1 and execute [PRVAR]

IIRC, both are in the PRINT menu. [PRVAR] also accepts a list containing the names of as many variables as you want to print.

Success!

Luiz (Brazil)

Edited: 16 May 2005, 4:18 p.m.

            
Re: How to print a program from a 28C ?
Message #3 Posted by marais on 16 May 2005, 4:57 p.m.,
in response to message #2 by Vieira, Luiz C. (Brazil)

Thank you Luiz, that worked, but I am somehow disappointed of the output. The program is shown with as many keywords per line as would fit - isn't there a way to format the output like on my trusty 97, with just one instruction per line?

                  
Re: How to print a program from a 28C ?
Message #4 Posted by Vieira, Luiz C. (Brazil) on 16 May 2005, 7:52 p.m.,
in response to message #3 by marais

Hi, Marais;

all I know is that you can automatically add an extra line feed (double space) with flag management. The only way theat comes to my mind now is to convert your program into a string by adding " in both top and bottom (sometimes it does not work due to special characters and existing strings inside the program; the HP48G allows better convertion) and add linefeed character after each valid space (should test for sequences without 'breaks').

I know this is not an answer, instead a thought of mine, but I don't recall having such 'line break' available. To be honest, when I'm listing RPL programs, I try to keep related instructions in one line, meaning I mainly remove line feed and add spaces manualy. For me it looks better, as RPL tends to be a structured language, but I know that the earlier HP programming structure (HP65 and ahead, till the HP33S) is better when seen line by line.

Sorry not helping much...

Luiz (Brazil)

                        
Re: How to print a program from a 28C ?
Message #5 Posted by Raymond Del Tondo on 16 May 2005, 9:39 p.m.,
in response to message #4 by Vieira, Luiz C. (Brazil)

Hi,

I'm not quite sure,
but I think there was kinda 'pretty print'
program for the HP-28S on www.hpcalc.org

At least worth taking a look.

Raymond

                        
Re: How to print a program from a 28C ?
Message #6 Posted by marais on 17 May 2005, 2:15 a.m.,
in response to message #4 by Vieira, Luiz C. (Brazil)

Luiz, I agree that RPL programs are best listed with related instructions in one line - that's what I do when I write them on paper, as I hardly never manage to get them right the first time (but that's a different story - yesterday I had to write my first RPL program after a long time, and boy did I take long!), but the little IR printer has it's own idea about what should fit in one line. I'll look for the pretty printer Raymond suggested. Thank you so far, gentlemen!

Andreas

                              
Re: How to print a program from a 28C ?
Message #7 Posted by Vieira, Luiz C. (Brazil) on 17 May 2005, 1:08 p.m.,
in response to message #6 by marais

Hi, Andreas;

I had the same surprise when first listing an RPL program in an 82240A. Mostly when I saw that the 82240A had a single space dot line between printed lines. The 82240B uses two space dot lines, it's a lot easier to read.

I have already searched all available HP28C/S related directories at hpcalc.org and found no specifc reference to pretty printer. I checked the whole hpcalc.org for pretty and print/printer/printing and found no specifc HP28C/S, too. Maybe it is no longer available, though.

I've been wondering about how to do a better printing with the HP82240, one line for each 'action' instead of one line for each command. I found no prectical way. For example, when STO appears as an instruction it must be kept in one single line, because whatever exists in level 1 and 2 is going to be used as parameter, and there is no way to specify. The one case I can think of is FOR with the variable name. As a general rule, if you convert the program listing to a string (there is a [->STR] in the HP28S repertoire and I forgot about it... I'm not sure if it breks the listing into many for each occurrency of a string in the program) and create a loop that replaces each SPACE character for a LINEFEED, than you can print the resulting string, that's gonna have single lines. One hint: if the resulting string is not broken with the occurrence of strings already existing inside the program AND you want these to be printed as a single line, i.e., keeping the spaces as spaces, then the 'converting loop' should detect the occurrence of '"' and wait tilll the next '"' prior to continue replacing.

Another thought of mine, not a solution...

Cheers.

Luiz (Brazil)

                                    
Re: How to print a program from a 28C ?
Message #8 Posted by Chan Tran (USA) on 19 May 2005, 3:03 p.m.,
in response to message #7 by Vieira, Luiz C. (Brazil)

Assuming that we can make the printer lists a program in any way we want, I still don't think there is a good way to list an RPL program on a 2" wide paper. RPL programs are best listed on a much wider paper or screen (like a computer screen or computer printer). And yeah the 28C/28S are the only RPL calcs that can't interface with a computer.

                                          
Re: How to print a program from a 28C ?
Message #9 Posted by marais on 19 May 2005, 4:44 p.m.,
in response to message #8 by Chan Tran (USA)

I came to the same conclusion while thinking about a pretty printer. The print-out is still a good way to archive a program (since the 28C/S doesn't have bidirectional I/O), but as far as readability is concerned, there really is not much we can do. That said, RPL pretty printing even on a line printer seems not that simple.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall