Hoppi RPL Library

Table of Contents


The Hoppi RPL library is written primarily for HP49G+/HP50G calculators to facilitate reliable communication with the Hoppi Mac application. The motivation for writing this library originally stemmed from the unreliability of my HP49G+'s built-in ``Transfer…'' program (accessible via APPS->I/O functions->Transfer) when choosing computer folders and listing files – it would often generate nonsensical Kermit packets. Hence this library was born, with features to control and examine the Hoppi Mac application program state.

The library is written in UserRPL and its contents can also be installed on HP48G calculators, but here there is less need for the library since the built-in ``Transfer…'' program works reliably with Hoppi.

Library commands are (by page):-


with one-line descriptions:-

  • Menu Page 1
    • HOPPI – a program for easy interactive use of the library commands
    • HPAR – change some calculator communication settings
    • HGETO – get an object from a computer file
    • HGETS – get a string representing the contents of a computer text file
    • HSNDO – send an object to a computer file
    • HSNDS – send the contents of a string to a computer text file
  • Menu Page 2
    • HRCV – receive object from computer
    • HRCD – change computer's current workspace folder
    • HRLD – list files in computer's current workspace folder
    • HROVR – get/set computer ``Overwrite Enable'' switch
    • HGCMD – invoke Kermit generic command

These commands are described in more detail in the following sections.

Building and Installing

The library is written in UserRPL, and its source code is distributed along with the Hoppi Mac application. It is created by transferring all the files to a calculator directory then running the CRLIB command from the HP50G's development library (library 256). Alternatively, it is also available as binary file ``hoppi.50g''.

Install this library into any port then do an ON+C restart to make its commands available.

Library Commands

HOPPI – an application for interactive file I/O

A simple (some might say crude) means of using the library commands interactively. Executing this command sets up a 3 page soft menu:-


where it is intended that these softmenu keys are to be used with the normal stack-based operation of the calculator. A one-line description of each softkey is:-

  • Menu Page 1
    • FAV – recall a frequently used object to the stack from a custom list (or with left-shift edit the custom list, see below)
    • PAR – change some calculator communication settings
    • CWD – retrieve the current remote working directory (or with left-shift set it)
    • OVR – retrieve the current "Allow Overwrite" setting (or with left-shift set it)
    • DIRS – retrieve a list of remote subdirectories
    • SELCT – select an item from a list (or with right-shift show a text-mode view of a long string or list of strings)
  • Menu Page 2
    • GETV – get a variable from a remote file
    • GETO – get an object (onto the stack) from a remote file
    • GETS – get the contents of a remote file as a string on the stack
    • RCV – receive an object (onto the stack) from a remote file
    • FILES – retrieve a list of remote files
    • SELCT – as menu page 1
  • Menu Page 3
    • SNDV – send a variable to a remote file
    • SNDO – send an object (from the stack) to a remote file
    • SNDS – send a string on the stack to become the contents of a remote file
    • VARS – get the list of variables of the current calculator directory
    • SELCT – as menu page 1

where it should be noted that the PAR, GETO, GETS, RCV, SNDO & SNDS softkeys simply invoke the HPAR, HGETO, HGETS, HRCV, HSNDO & HSNDS library commands directly (the ``H'' prefix being removed to aid readability in the cramped soft menu). Also, the GETV and SNDV menu keys are aliases for the KGET and SEND commands, respectively.

In lieu of some proper documentation of these softmenu commands, a typical session using the Hoppi-specific commands may go as follows:-

Press CWD, resulting in a string representing the current remote directory appearing on the stack. It's too long to see properly, so press RS-SELCT to view it in text SCROLL mode. Press DIRS, getting a list of the remote subdirectories available. They're difficult to read so Press RS-SELCT to see them printed one-entry-per-line. Press SELCT to choose one of these subdirectories. Press LS-CWD to change to it.

Press FILES to get a list of the remote files available. Press SELCT to choose one of them. Press GETO to transfer the contents of the file to the calculator stack, where it is automatically converted to a calculator object. Or maybe press GETS to transfer the contents of the file so that it is received as a calculator string object.

Recall a calculator object to the stack. Enter a name to use as a remote filename (either a string or a symbol). Press SNDO to send it as a calculator object.

Recall a calculator string to the stack. Enter a name for the remote filename and press SNDS to transfer the contents of the string to the remote file.

Change some calculator communication parameter settings (binary or ASCII mode, ASCII translation level, local overwrite enable) by pressing PAR.

Recall a frequently used calculator object to the stack by pressing FAV. This runs a CHOOSE command on the {HOME Hoppi Fav} calculator object which should be a list of two-element lists, each containing a display name string and the useful object itself. For example, this list can contain frequently used remote directories, so that by pressing FAV, UP/DOWN… ENTER then LS-CWD you can be taken directly to your remote directory of choice. Or you might store programs here (e.g. for selective backups), to be recalled then executed by pressing EVAL.

As you may have noticed, the Hoppi commands are all stack-centric, that is, they get and return the transferred objects from and to the stack. This is in contrast to the built-in RPL commands which tend to work with global variables. Keep this in mind when reading the command documentation in the following paragraphs, where a $ and {} notation has been used to suggest string and list arguments, respectively.

HPAR – Hoppi Parameters

( –> )

Opens a form to set the calculator communication parameters relevant to Hoppi-specific commands.

HGETO – Hoppi Get Object

( $name –> obj )

Retrieve the calculator object previously stored in the remote file named $name and return it to the stack.

HGETS – Hoppi Get String

( $name –> $contents )

Read the contents of the remote file named $name and return as a string to the stack.

HSNDO – Hoppi Send Object

( obj $name –> )

Send the object to the computer to be saved as file named $name.

HSNDS – Hoppi Send String

( $contents $name –> )

Send the string $contents to the computer so that its contents become the contents of the file named $name.

HRCV – Hoppi Receive

( –> obj )

Accept a file sent by the Hoppi program on the computer and return the received object to the stack.

HRCD – Hoppi Remote Change Directory

( $dir –> $currdir )

where $dir should be a string representing the desired new directory.

The response will be the absolute path of Hoppi's current workspace directory. Examples:-

1) "/Users/pdo/RPL/" HRCD

   will cause Hoppi to change to the given absolute path, returning
   "/Users/pdo/RPL/" as a string.

2) ".." HRCD

   will then cause Hoppi to change directory and return a
   "/Users/pdo/" string.


   will change directory and return "/Users/pdo/RPL/".

4) "." HRCD

   will not change directory, but will return "/Users/pdo/RPL/".  So
   this variant can always be used to return the path of the current
   workspace directory without causing any changes.

5) "" HRCD

   will change to the user's home directory, "/Users/pdo/" in this

HRLD – Hoppi Remote List Directory

( $dir –> $dir {$subdirs} {$files} )

where $dir should be a string representing the desired directory to list. It can be relative or absolute, where relative means relative to the current workspace directory.

The command returns three values: the absolute path of the listed directory, as a string, a list of subdirectory name strings and a list of file name strings. Examples

1) "/Users/pdo/" HRLD

   lists the given directory.


   lists the RPL subdirectory of the current workspace directory.

3) "" HRLD

   list the current workspace directory.

HROVR – Hoppi Remote Overwrite

( x –> x' )

where x is a real number. If x > 0 then turn on "Allow Overwrite" or if x = 0 then turn it off. If x < 0 then don't change it. In any case return the new setting (0 for off, 1 for on).

HGCMD – Hoppi Generic Command

( $cmd $param –> $response )

( $cmd {$params} –> $response )

where $cmd should be a string containing a single character, $param a string containing a command parameter, and {$params} a list of strings containing command parameters.

Invoke a Kermit generic command and return its response. The response from Hoppi is returned in the $response string.

Version History

Hoppi RPL Library Version 0.4

Basic functionality working.

Author: Paul Onions

Created: 2015-03-14 Sat 17:58

Emacs 24.4.1 (Org mode 8.2.10)