The Museum of HP Calculators

HP Forum Archive 17

[ Return to Index | Top of Index ]

Editor on Mac or PC for 50g programs
Message #1 Posted by Miguel Reznicek on 25 Sept 2007, 11:37 a.m.

Friends: What do you all use to edit and prepare programs for the 50g when doing so on an Win XP driven PC? Does anyone use a Mac with OS X for this? I was thinking a text editor like BBEdit, then saving to the SD card, then into the 50g. What file extension should be used? Comments? Ideas? Suggestions?

Thanks, -Migs

      
Re: Editor on Mac or PC for 50g programs
Message #2 Posted by James M. Prange (Michigan) on 25 Sept 2007, 10:33 p.m.,
in response to message #1 by Miguel Reznicek

Quote:
Friends: What do you all use to edit and prepare programs for the 50g when doing so on an Win XP driven PC?
Well, I simply use my favourite text editor, TSE Pro.

I normally use translation mode 3, which can be set by doing 3 TRANSIO, or by editing the last element in IOPAR to 3, or by choosing Xlat:CHR 128-255 in an input form.

Of course you could use a different translation mode, but depending on the character set in use, it may be difficult to read some non-ASCII characters, and somewhat of a pain to enter them.

Quote:
Does anyone use a Mac with OS X for this? I was thinking a text editor like BBEdit,
I don't have any experience with a Mac, but any text editor should be okay; even MS Notepad will work in a pinch. Just use whichever one you prefer. Even a "word processor", such as MS Word or WordPerfect, should work, as long as the files are saved as plain text, to avoid having the word processor's control codes or escape sequences stored in the file.

Using an ordinary text editor means that you have to learn some translation sequences for non-ASCII character, but I expect that the ones that you frequently use will be easy to remember. For a User-RPL program that builds a character string that looks like a translation table for characters 128-255, you could use the program:

%%HP: T(3)A(R)F(.);
@ For 49G, 49g+, 48gII, or 50g only.
@ Checksum: # A162h
@ Size:       116.5
\<<
  ""
  128 255
  FOR n
    "\010"
    n
    " "
    OVER R\->B
    OVER +
    PICK3 CHR
    PICK3
    OVER
    # 2F34Eh SYSEVAL    @ KVIS for 49 series.
    + + + + + + +
  NEXT
  "\010" +
\>>
Or a faster SysRPL version is included with my "ASCII on SD" package.

Which characters are actually translated by the above program depends on which translation mode is in effect when the program is run. Of course, how the characters look depends on which font is current when the string is viewed.

Of course, once the string is built, you could store it as a global variable, so you wouldn't have to run the program again.

In addition, in modes 1-3, LineFeed codes are translated to CarriageReturn-LineFeed pairs, and in modes 2 and 3, \ is translated to \\.

Quote:
then saving to the SD card, then into the 50g.
Well, there's a minor problem with that. Any transfers between the flash card and the calculator are "binary" transfers, so the entire file contents would be stored within a character string object, instead of being translated and compiled as the intended object. For a work-around, see http://www.hpcalc.org/search.php?query=ASCII+on+SD.

For some more general information, see my recent post.

The source code file should have an ASCII transfer header similar to:

%%HP: T(3)A(R)F(.);
This header tells the calculator, first, that it's to be treated as an ASCII transfer, then the T() parameter tells it which translation mode (0-3) to use, then the A() tells it which angular mode, D for Degree, R for Radian, or G for Grad, and the F() tells it which is the fraction mark, . for period or , for comma. These parameters can be in any order, and if any parameters are missing, then the current mode is used. A very minimal ASCII transfer header would be:
%%HP: ;
This would tell the calculator that it's an ASCII transfer, but whichever modes happened to be current would be used.

Unfortunately, the ASCII transfer header doesn't include any information on whether a number without any fraction mark should be treated as a "real number" or a zint (exact integer). In general, if the source code was originally written for (or transferred from) a 48 series, have the 49 series in "approximate" mode, so that such numbers will be compiled as reals, or if the source code was originally for the 49 series, have the 49 series in "exact" mode, so that such numbers will be compiled as zints. This also applies to "real arrays" and "symbolic matrices".

Quote:
What file extension should be used?
The calculator doesn't pay any attention to a file extension; it's just part of the global name that will be used, except that if you have the "fraction mark" set to comma instead of period (dot), then the "dot" will be treated as a separator instead of part of the name. So if you use the comma for a fraction mark, it's best not to use any file extension, or if you use the period as the fraction mark, use any valid file extension that you like.

Other than that, Conn4x can be set up to use a .hp extension for files that it stores on the PC, and the .hp is removed before the variables are stored on the calculator.

Quote:
Comments? Ideas? Suggestions?
If you'd like to use a USB connection instead of a flash card, you could try HPConnect on a Mac with OS X 10.3 or later.

Just so they don't feel left out, any Linux users could try HPTalx.

A "special" (MS Windows) editor that many seem to like is HPUserEdit. This editor uses a character set that matches the calculator's, and if I recall correctly, you select a non-ASCII character with a mouse click. I find it much easier to use my text editor and simply type in any translation sequences, but I realize that preferences do vary.

Regards,
James

Edited: 27 Sept 2007, 7:18 a.m. after one or more responses were posted

            
Re: Editor on Mac or PC for 50g programs
Message #3 Posted by Miguel Reznicek on 26 Sept 2007, 4:40 p.m.,
in response to message #2 by James M. Prange (Michigan)

Hi James:

Quite a bit of info there! OK. I'm going to do as you say step by step and post if I get stuck. I'll also look at those other links to see how I relate to them.

I appreciate your explanation in detail! I have it printed out and am begining to work it.

All the best, -Migs


[ Return to Index | Top of Index ]

Go back to the main exhibit hall