[comp.sys.handhelds] HP48: putting it in alpha mode

khbsnsr@nmt.edu (Kenneth Brunell) (03/07/91)

I don't think my first attempt got posted so I'll try again:

There was a thread on this a month or so ago, but I never saw an actual
answer to the problem.  I want to know how to start up the INPUT command
with the keyboard in alpha mode.  A syseval probably?  I haven't seen 
anything particularly helpful in the manual, tho it could still be 
lurking in there.

thanks

-Ken
--
-------------------------------------------------------------------------------
|  _   ,                __                     _  _  |  "It's green . . ."    |
| ' ) /                /  )                   // //  |       Mr. Scott        |
|  /-<   _  ____      /--<  __  . . ____  _  // //   |                        |
| /   ) </_/ / <_    /___/_/ (_(_/_/ / <_</_</_</_   |   Loooove that .sig    |
|          <khbsnsr@jupiter.nmt.edu>                 |                        |
===============================================================================

stevev@greylady.uoregon.edu (Steve VanDevender) (03/09/91)

Admittedly, the HP-48 manuals are OK tutorials but horrible
reference manuals.  However, the INPUT command is fairly well
documented in volume II on pages 526-528.  To summarize, the
level 2 argument to INPUT is the prompt string, and the argument
in level 1 determines the initial command line you can edit and
the input state.  If the level 1 argument is a string, then that
string is placed in the command line for editing with the cursor
at the end.  The level 1 argument can also be a list containing
any of the following three types of objects in any order:

1.  An initial command line string.

2.  The cursor position, either as a real number specifying the
character position in the given command line string or a list of
two reals, where the first specifies the line and the second the
column in the command string.  A negative single real or a
negative row number in the list tells INPUT to use the replace
cursor instead of the insert cursor.  A real 0 specifies the end
of the command string or the end of a line in the command string.

3.  Any of three unquoted global names specifying special input modes:

ALG for algebraic program entry mode
\Ga (Greek alpha) for alpha entry mode
V to check the command line for proper syntax; it must parse to
one or more valid objects.

I use INPUT as the basis of a simple text editing and storage
application, with a simple custom menu and small program, and use
INPUT with alpha entry mode in a string search function.  Here
is the custom menu and the program:

'CST':

{
  { "EDIT" \<< 0 EDIT \>> }
  { "FIND" \<< DUP "Find:" { \Ga \} INPUT POS EDIT \>> }
}

'EDIT':

\<<
  IF DEPTH 2 \>=
  THEN
    2 \->LIST "" SWAP 28 MENU INPUT 2 MENU
  END
\>>

I have these together in a subdirectory along with another
directory, FILES, which contains a bunch of string variables.  To
examine a string, I cd to FILES, recall one of the strings, then
press CST and EDIT.  To search for a substring in a string, I
recall a string, press CST and FIND, then enter the substring to
search for.  FIND then brings up the string in INPUT with the
cursor positioned on the first character of the found string.  If
I want to save the changes after editing a string, I get back to
the VAR menu and store the modified string back in the variable I
got it from.

Since INPUT basically gives you access to the full text-editing
mode built in to the 48, it's almost the perfect solution.  Man,
I love this machine :-).  All I could ask for is cut-and-paste
editing in INPUT mode, but that would probably require some more
complex programming.  Pasting is easy since you can go into the
interactive stack and ECHO in strings already on the stack, but
the only solution I can think of for a cut function is to put
special begin and end marker characters in the string and write a
program to find them and do a SUB to extract the substring
between them.


--
Steve VanDevender 	stevev@greylady.uoregon.edu
"Bipedalism--an unrecognized disease affecting over 99% of the population.
Symptoms include lack of traffic sense, slow rate of travel, and the
classic, easily recognized behavior known as walking."