HP Forums

Full Version: Formatting 28/48/50 programs
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

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.

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.

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)

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.

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.

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.

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

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 :

Is there a version for the Mac?

No,It is only for Windows as far I know