The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

Formatting 28/48/50 programs
Message #1 Posted by Matt Agajanian on 4 June 2012, 11:36 p.m.

Hello all.

Is it possible to enter programs into the 28, 48 or 50 with carriage returns or other spacing, indents/formatting so that when they're viewed on screen for editing the format is vertical and line breaks occur as desired? For example:

<< -> n
<< 0 1 n FOR Z
Z +
NEXT >>
>>

Thanks

Edited: 5 June 2012, 12:44 a.m.

      
Re: Formatting 28/48/50 programs
Message #2 Posted by C.Ret on 5 June 2012, 8:05 a.m.,
in response to message #1 by Matt Agajanian

Quote:
Hello all.

Is it possible to enter programs into the 28, 48 or 50 with carriage returns or other spacing, indents/formatting so that when they're viewed on screen for editing the format is vertical and line breaks occur as desired? For example:

<< -> n
<< 0 1 n FOR Z
Z +
NEXT >>
>>
Thanks


Hi,

That's a good question. And a lot of RPL users may have appreciate this feature.

Unfortunately, as soon as you enter your code into the calculator, any carriage-return, double space or any other separator or duplicated separators are all discarded. In fact, the internal representation of any code is based on address-code, no trace of any separator are kept.

Edited: 5 June 2012, 8:06 a.m.

      
Re: Formatting 28/48/50 programs
Message #3 Posted by Luiz C. Vieira (Brazil) on 5 June 2012, 9:20 a.m.,
in response to message #1 by Matt Agajanian

Hi.

I usually do this manually, have not found any application that might be able to do that. But I'd not discard the programming features available in some powerful text editors, like Emacs, that could be properly programmed to modify a text file and generate, add such level of editing.

Cheers.

Luiz (Brazil)

            
Re: Formatting 28/48/50 programs
Message #4 Posted by Christoph Giesselink on 5 June 2012, 1:11 p.m.,
in response to message #3 by Luiz C. Vieira (Brazil)

Quote:
I usually do this manually, have not found any application that might be able to do that. But I'd not discard the programming features available in some powerful text editors, like Emacs, that could be properly programmed to modify a text file and generate, add such level of editing.

Nearly decades ago I wrote a DOS program called STRUCTHP available at http://hp.giesselink.com/pcuti.htm exactly doing this. The disadvantage, the program is so old that the program documentation and messages are only available in German.

The program can format many types of programs in ASCII format. In the case of a HP48 ASCII file with the header

%%HP: T(3)A(R)F(.);

you can call STRUCTHP with

structhp /48:L3 infile outfile

where

  • /48:L3 is an option to tell structhp that the infile is an HP48 ASCII file with the %%HP: header and that the output file should be still an HP48 ASCII calculator file in translation mode 3
  • infile is the source file name
  • outfile is the destination file name

There're many other options to change the no. of blanks for insertion or changing right and left margins.

All listings in the book http://www.amazon.de/28S-48-Programme-Mathematik-Elektrotechnik/dp/3882290315 have been formatted with this tool.

Cheers

Christoph

      
Re: Formatting 28/48/50 programs
Message #5 Posted by Han on 5 June 2012, 11:11 a.m.,
in response to message #1 by Matt Agajanian

What you could do is edit the program as a "string" object and then save the program as a string with all the formatting you wish. When you want to run the program, just type: STR-> and evaluate the program.

<<
  "

(your source code here)

" STR-> EVAL >>

This does not always work perfectly (as you cannot use string objects inside such program) using the built-in command line editor. However, a program like Emacs or Jazz's editor will handle this just fine

Edited: 5 June 2012, 11:13 a.m.

      
Re: Formatting 28/48/50 programs
Message #6 Posted by Jeff Johnson on 5 June 2012, 12:02 p.m.,
in response to message #1 by Matt Agajanian

Matt,

My simplistic technique for my HP 50g has been to do all my editing as a nicely formatted/commented text file on a PC. I then copy to the 50g and execute the program. If there's an error, I make the change on the PC and copy over again. I don't debug on the calc at all. Just my 2 cents.

            
Re: Formatting 28/48/50 programs
Message #7 Posted by Matt Agajanian on 5 June 2012, 12:21 p.m.,
in response to message #6 by Jeff Johnson

Good point. As 'HPConnect' ( HPConnect ) allows me to use the 50G with my Mac, this sounds like a viable option for me.

Thanks

Edited: 5 June 2012, 12:25 p.m.

      
Re: Formatting 28/48/50 programs
Message #8 Posted by Gilles Carpentier on 5 June 2012, 5:25 p.m.,
in response to message #1 by Matt Agajanian

Hi Matt,

It is not possible as far I know _on_ the calculator, but you can use a PC. I like very much HPUserEdit 5 for this. It works directly with emu48 and you can transfer programs on a real calc via Conn4x

http://www.hpcalc.org/details.php?id=6600

it is in spanish by default but you can choose english (or french) language (not all is translate but very easy to use). Includes 'wizards' for CHOOSE and INFORM

user screen :

            
Re: Formatting 28/48/50 programs
Message #9 Posted by Matt Agajanian on 6 June 2012, 1:52 a.m.,
in response to message #8 by Gilles Carpentier

Is there a version for the Mac?

                  
Re: Formatting 28/48/50 programs
Message #10 Posted by Gilles Carpentier on 6 June 2012, 6:01 p.m.,
in response to message #9 by Matt Agajanian

No,It is only for Windows as far I know


[ Return to Index | Top of Index ]

Go back to the main exhibit hall