The Museum of HP Calculators

HP Forum Archive 16

[ Return to Index | Top of Index ]

Those solid block characters in the characters menu.
Message #1 Posted by J.C. Boco on 2 Nov 2006, 12:49 p.m.

When you hit rightshift and char, in order to get to the screen with all of the various characters and symbols the calculator uses, there are a bunch of solid black boxes heading the list. I'd like to modify how each of these look and use them for variables, but when I use the resulting symbol in an equation I get a context error or something. Does anyone know what these characters are for?

      
Re: Those solid block characters in the characters menu.
Message #2 Posted by Marcus von Cube, Germany on 2 Nov 2006, 1:12 p.m.,
in response to message #1 by J.C. Boco

If you look at an ASCII code table, you will notice that codes below #32d (#20h, Space) are designated to control functions. On your PC, these are created by holding down the Ctrl key together with a character key.

Some of these have well known names, such as SOH, STX, ETX, EOT, BS, CR, LF, FF, DLE, XON, XOFF. They have special meanings to devices that understand them (e. g. a printer feeds the paper one line if it encounters a LF, #10d.) In most fonts the control characters aren't assigned.

The black boxes in the character table of the 48/49/50 series are these control characters. The command line parser seems to handle them in a special way so that they can't be used outside of strings.

Marcus

            
Re: Those solid block characters in the characters menu.
Message #3 Posted by James M. Prange (Michigan) on 2 Nov 2006, 8:40 p.m.,
in response to message #2 by Marcus von Cube, Germany

True, the codes 0d through 31d and 127d are "ASCII control codes". The calculators use 10d (ASCII Line Feed) as a "New Line" code. In the 48 series, 27d (ASCII Escape) causes the parser to ignore at least some of the restrictions on the following character.

Some of the control codes (which ones depend on the model) have a "graphical representation" other than the small square.

Other than that, the ASCII control codes (except 27d), along with the characters space, semicolon, and whichever of period or comma is not the "fraction mark" character, function as separator characters (like "white space") for the parser. On the 48 series, character 160d (ECMA 94 "non-breaking space") is treated the same as a space character and is a separator, but in the 49 series, 160d is used for the Euro character, and is not a separator.

But note that the semicolon character by itself (enclosed by separators) is a command on the 49 series. If there's anything on the stack, it behaves the same as DROP; otherwise it does nothing.

Any series of separators is treated the same as a single separator.

According to ECMA 94, codes 128d through 159d are control codes, but the calculators treat them as ordinary "graphic" characters.

Within a character string, all characters are treated as "literal characters", never as separators or delimiters. One may want to use control codes as printer commands or escape sequences, or one could have an application parse a string according to its own rules.

Regards,
James

Edited: 2 Nov 2006, 9:03 p.m.

                  
Re: Those solid block characters in the characters menu.
Message #4 Posted by James M. Prange (Michigan) on 3 Nov 2006, 1:12 a.m.,
in response to message #3 by James M. Prange (Michigan)

PS:

Certain restrictions are (ordinarily) imposed on global names. Most of these are for the sake of the parsers. For example, a global name should not contain any separators ("white space"), any delimiter characters, any of various mathematical operator characters (such as +, -, *, /, <, =, >, and so on), it shouldn't start with a numeric character (numerals 0 through 9 and whichever of period or comma is the fraction mark), although you can have numeric characters anywhere else in the name, and it shouldn't be the same as a built-in name. Also, a global name should have at least one character and no more than 127 characters.

I don't know the reason for the restriction to 127 characters; the two-nibble "character count" field in a global name object should allow up to 255 characters, although 127 characters seems "long enough" for my purposes. Perhaps it was a restriction imposed by whatever operating system or compiler the developers of UserRPL were using, or perhaps it was originally a "nibble count" (like some other objects have) instead of a "character count" (or maybe someone was thinking that it was).

However, the 48 and 49 series do have a $>ID SysRPL command that converts a character string to an ID (global name), and an ID>$ SysRPL command that does the reverse. On the 49 series, if you have library 256 attached, you can use the S~N command to toggle a string to a global name or vice versa. Also on the 49 series, the filer has a "RENAME" operation that allows you to replace any global name with any other name. These work with any string of up 255 characters, even to make what would otherwise be "invalid" as a global name. I don't recall exactly what happens if you try making a global name with over 255 characters, but I expect that it would be a bad thing to do.

So you can make a global name such as 'A B' that contains a separator, or '1+2' which begins with a numeric character and contains a mathematical operator, or 'SIN' that duplicates a built-in name, or with up to 255 characters. However, the wisdom of doing so seems very doubtful, as the parsers, such as pressing ENTER with a command line present, perhaps other editors such as the equation writer or matrix writer, STR\-> (which I think Conn4x "Text" transfers use), OBJ\-> on a string, or receiving a Kermit "ASCII" transfer, will very likely interpret the "global name" differently from what you intended, or give you an "Invalid Syntax" error.

Also note that Conn4x translates (if needed) global names to file names that are valid as "long file names" for MS Windows on transfers from the calculator, and does the reverse translation on transfers to the calculator.

For storing as a binary-transferred file on an MMC or SD card, if the global name would be a long file name with MS Windows, the file is stored with both the long file name and an "8.3" MS-DOS short file name.

For other file transfers, such as Kermit or Xmodem, you should choose a name that will be valid both as a global name and a file name for whatever file system is used on the other device.

Note that if you have the calculator set to use the comma as the fraction mark, then the period is a separator, so transferring a file with a "file name extension" to the calculator fails.

Regards,
James

      
Re: Those solid block characters in the characters menu. (49 series)
Message #5 Posted by James M. Prange (Michigan) on 2 Nov 2006, 8:04 p.m.,
in response to message #1 by J.C. Boco

It's been a while since I've done this, so I'm a bit fuzzy on the details, but you can make your own custom fonts.

When you're in the character browser, highlight the character that you want to modify and press the MODIF (D or F4) menu key. A "pixel map" of the character will be displayed, with the current pixel indicated by a small square. Press the "." key to toggle the pixel between off and on. Press the menu key SCAN to go back to the character browser, or CHR- or CHR+ to step to a different character. Press either CANCEL or ENTER to exit the browser and have the modified font used as the "current font".

To save the font, execute FONT\-> to put the current font on the stack (it will look similar to: Ft8_0:SYSTEM 8), and the store it in a global variable with whatever name you like. The built-in fonts can be recalled with the FONT6, FONT7, and FONT8 commands, and a font on level 1 is made current with the \->FONT command.

Also, for more information, try searches at http://groups.google.com/group/comp.sys.hp48? and http://www.hpcalc.org/. You can probably find some custom fonts at http://www.hpcalc.org/.

For the 48 series, this isn't built-in, but search for something like "universal font".

Regards,
James


[ Return to Index | Top of Index ]

Go back to the main exhibit hall