HP Forums
Slashes in HP48 source code - 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: Slashes in HP48 source code (/thread-86798.html)



Slashes in HP48 source code - Kieron Abbott - 02-03-2006

I'm a new HP48 user who recently inherited my dad's old 48G. I have a question about 48 source code with slashes. In the Advanced User's Guide, there are no slashes in the program listings, but in the source on the Goodies Disks and most places online (i.e. at http://www.hpmuseum.org/software/48vigenc.htm), there are slashes "\" before each << and >>. Can someone clue me in as to what these signify, and whether they are necessary?


Re: Slashes in HP48 source code - Gerson W. Barbosa - 02-04-2006

Those back-slashes are used to represent the 48G characters with ASCII codes above 127 with characters in the first half of the ASCII table, which is standard for all code pages. For instance, \<< and \>> stand for the program delimiters and \PI stands for the pi symbol.

Refer to the HP 48G User's Guide, page 27-16, for the complete ASCII Characters Translations table.


Re: Slashes in HP48 source code - Howard Owen - 02-04-2006

Those slashes mark characters that don't have equivalents in ASCII. A 48/49 series calculator will insert them into an RPL program transferred in "text" mode to a PC. So, for example \<< stands for the character with decimal code 171 in the calculator's character set. \>> similarly stands for the character with code 187. If you type these translated codes into a source file on the PC, then transfer it to the calculator in text mode, the kermit server will do the opposite translation, from the backslash escaped codes to the ASCII equivalent. The hp 49g+ & 48gII_advanced user's reference manual (HP link) has a table of these translations in Appendix J. I think they are broadly similar to the 48G translations, though there might be differences in detail.

Regards,
Howard


Re: Slashes in HP48 source code - Kieron Abbott - 02-04-2006

So, if I was going to type a program directly into my calculator from a source file on my computer, I would simply ignore the replace \<< and \>> with << and >>, and other characters such as \pi with the actual pi symbol?
BTW, have you seen Pi: Faith in Chaos? It's good.


Re: Slashes in HP48 source code - Howard Owen - 02-04-2006

Quote:
So, if I was going to type a program directly into my calculator from a source file on my computer, I would simply ignore the replace \<< and \>> with << and >>, and other characters such as \pi with the actual pi symbol?

That's right. Most of the escaped symbols are easy to guess, like \>>, \<< and \->. For others you need the tables Gerson and I pointed you to.

Quote:
BTW, have you seen Pi: Faith in Chaos? It's good.

No. I'm culturally isolated. 8)

Regards,
Howard


Re: Slashes in HP48 source code - Kieron Abbott - 02-07-2006

Thanks very much! I just typed in by hand a Pythagorean triangle calculator and it worked fine. I appreciate everyone's help.