HP Forums
How to print a program from a 28C ? - Printable Version

+- HP Forums (https://archived.hpcalc.org/museumforum)
+-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html)
+--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html)
+--- Thread: How to print a program from a 28C ? (/thread-73532.html)



How to print a program from a 28C ? - marais - 05-16-2005

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 ? - Vieira, Luiz C. (Brazil) - 05-16-2005

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 ? - marais - 05-16-2005

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 ? - Vieira, Luiz C. (Brazil) - 05-16-2005

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 ? - Raymond Del Tondo - 05-16-2005

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 ? - marais - 05-17-2005

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 ? - Vieira, Luiz C. (Brazil) - 05-17-2005

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 ? - Dia C. Tran - 05-19-2005

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 ? - marais - 05-19-2005

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.