How to make HP48G inputforms in System-RPL by Sune Bredahl, ec947086@ebar.dtu.dk If you're familiar with programming in system-RPL, then here's some info on making *fast* dialog-boxes (input forms) on the '48G. This includes _all_ types of standard fields: (DF) Data fields: ( normal INFORM-style input fields ) (EDF) Extended data fields: ( allows you to select from var. browser ) (LF) List fields: ( have pre-determined set of values ) (CF) Check fields: ( checkmark-style fields ) The following is completely undocumented so don't blame me if anything screws up. ***************************************************** The internal INFORM command has the address #199EB (!) and accepts input arranged the following way; * LABEL DEFINITIONS "label" ( label string for field ) #x_offset ( display x-coordinate ) #y_offset ( display y-coordinate ) ( more label definitions follow... ) * FIELD DEFINITIONS ' DROPFALSE ( each field starts with DROPFALSE ) #x_offset ( display x-coordinate ) #y_offset ( usually label#y_offset + #2 ) #lenght ( length of field ) #height ( usually NINE ) #menutype ( DF:ONE, EDF:TWENTYTHREE LF:TWELVE CF:THIRTYTWO ) { #type1 #type2 ... } ( valid USER-types, LF/CF:MINUSONE ) #fieldstyle? ( FOUR:DF/EDF, SEVENTEEN:LF, MINUSONE:CF ) "helpInfo" ( help string ) "vartxt" or { list } ( EDF:"vartxt" LF:{ { "Hi" foo } etc. }, DF/CF:MINUSONE ) #? ( LF:SEVENTEEN, CF/DF/EDF:MINUSONE ) resetvalue ( DF/EDF:any/MINUSONE, LF:{ "Hi" foo }, CF:TRUE/FALSE ) initvalue ( same as above ) ( more field definitions follow... ) * GENERAL INFO #labels ( number of labels ) #fields ( number of fields ) ' DROPFALSE "TitleString" ( Title-string ) Note that #labels and #fields can be different. If you want some text anywhere in the dialog box, then just enter it/them as the first label definition(s) and change #labels accordingly. All text-strings can be replaced with msg. numbers if you want to re-use some of the built-in stuff. Stack output is this: N+1: field1 N: field2 ... 2: fieldN 1: TRUE/FALSE ; FALSE if [CANCEL] was pressed else TRUE For each field type the output is; DF/EDF: any ( MINUSONE if empty/NOVAL ) CF: TRUE/FALSE LF: { "Label" foo } Note that the List Field returns the entire input-list and not only . However, if is the program DROP , then one can simply COMPEVAL the list to execute . This approach is useful if using the field to control some system settings (see example below). ' DROPFALSE can be executed via #3A9B8 so a few bytes can be saved. Here's an example; ASSEMBLE * unsupported entry points HALTOK? EQU #1446F HALTERR EQU #10FC6 sysINFORM EQU #199EB 'DROPFALSE EQU #3A9B8 NIBASC /HPHP48-K/ RPL :: CK0NOLASTWD ( no args req'd ) * always check if HALT is allowed HALTOK? NOTcase HALTERR * definitions of labels "Some text" ONE TWELVE "CHECK" FIFTYTWO TWELVE "Normal" ONE TWENTYONE "List field" ONE THIRTY "Press CHOOSE" EIGHTY THIRTY * definitions of fields 'DROPFALSE FORTYFIVE ( x - offset ) TEN ( y - offset ) SIX ( checkmark uses six pixels ) NINE ( standard height ) THIRTYTWO ( CF menu ) MINUSONE ( not used by this field ) DUP ( neither is this ) "Also use [+/-] to check this" ( help text ) MINUSONE ( not used by this field ) DUP ( ditto ) TRUE ( checkmark ON is reset value ) DUP ( and init value too ) 'DROPFALSE THIRTY ( x - offset ) NINETEEN ( y - offset ) FIFTY ( lenght of field ) NINE ( normal height ) ONE ( DF menu ) { ZERO ONE } ( real and complex nums are valid ) FOUR ( DF field ) "Enter real or cmplx num." ( help text ) MINUSONE ( not used by this field ) DUP ( ditto ) % 0.0001 ( reset value ) MINUSONE ( no initial value / NOVAL ) 'DROPFALSE FIFTY ( x - offset ) TWENTYEIGHT ( y - offset ) TWENTYSEVEN ( lenght of field ) NINE ( height ) TWELVE ( LF menu ) MINUSONE ( not used by this field ) SEVENTEEN ( LF field ) "Also use [+/-] to select" ( help text ) { { "RAD" DROP SETRAD } ( Field contents ) { "DEG" DROP SETDEG } ( First text-string is shown ... ) { "GRAD" DROP SETGRAD } } ( and selected 'list' will be popped on stack ) SEVENTEEN ( dunno ) { "RAD" DROP SETRAD } ( reset value ) DUP ( and init value too ) 'DROPFALSE EIGHTY ( x - offset ) THIRTYSEVEN ( y - offset ) FIFTEEN ( lenght of field ) NINE ( height ) TWENTYTHREE ( EDF menu ) { ZERO } ( not used by this field ) FOUR ( EDF field ) NULL$ ( no help info ) "Reals in" ( Choose-menu string ) MINUSONE ( not used by this field ) %2 ( reset value ) DUP ( and init value too ) * general info FIVE ( four labels ) FOUR ( three fields ) 'DROPFALSE "(C) SUNE BREDAHL '94" ( title string ) * now we're ready sysINFORM NOT ( if cancel was pressed ) ?SEMI ( then exit program ) 4UNROLL COMPEVAL ( execute list with angle prog ) DUP MINUSONE ( check for empty field ) EQUAL IT :: DROP "No number entered !" ; SWAP ITE "Checkmark OK !" "NO Checkmark !" SWAPROT ; You don't have to compile this to see the result - just run EXAMPLE (distributed with this doc). Enjoy Sune Bredahl