Article 4902 of comp.sys.handhelds: Newsgroups: comp.sys.handhelds Path: en.ecn.purdue.edu!noose.ecn.purdue.edu!news.cs.indiana.edu!rsg1.er.usgs.gov!rsg1.er.usgs.gov!stevev From: stevev@greylady.uoregon.edu (Steve VanDevender) Subject: Re: HP48: putting it in alpha mode In-Reply-To: khbsnsr@nmt.edu's message of 7 Mar 91 11:50:16 GMT Message-ID: Followup-To: comp.sys.handhelds Sender: news@rsg1.er.usgs.gov Organization: University of Oregon Chemistry Stores References: <9103061705.AA08584@uceng.UC.EDU> <1991Mar7.115016.9062@nmt.edu> Date: 9 Mar 91 01:07:55 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."