HP'98 MPR V1.2 (beta)

I am Mexican, so excuse my english.

	Hello, my name is Samuel Mathieson, I helped Brandon Moro create HP'98. This version however is different, it is has multitasking!
	This version of HP'98 is more advanced than HP'98 V2.2, however this version has not proven itself like HP'98 V2.2.
	HP'98 MPR is a far second cousin of the first HP'97, it is written entirely in Sys-RPL and unlike all its predecessors this version is Multi Program Running. Yes, finally I have figured out how to get a minimal kind of multitasking, I could do it alot better but not without adding at least another 5kbytes to the library. HP'98 V2.2 programs are NOT compatible with HP'98 MPR, they will run, but they wont be multitasked!!! I have included a prog to change them to MPR programs.
	In this ZIP file you will also find DP'98, a library entirely my idea and creation, it will let you add sound themes, background wall paper, custum key definitions, and many other things to HP'98, it will also give you the capability of using the built in features of HP'98, such as the menus, message boxes, choose boxes, mouse, etc. to create your own "HP'98 apps".
	The file Default.SND is simply a special backup I created to give you an initial sound themes when restored.

HP'98 is 9,921.5 bytes in size, and has a CRC of # FF01h
DP'98 is 3,178 bytes in size, and has a CRC of # 3FB3h


To get you started.
	When I joined Brandon Moro to help him better HP'97 I found a program terribly slow and inneficient, sometimes you HAD to use keys, sometimes the mouse, I made it a point that throughout HP'98 EITHER could be used, no matter what, and at ANY time. Usage is simple, the mouse scrolls with the number keys, and to 'click' it use the 5 key (0 key has no meaning).
The 'Start' menu can be invoked by either clicking on the taskbar ontop of the start menu, or pressing the 'A' key. Inside the menus one can either use the mouse and click or use the 'UP' and 'DOWN' arrow keys to move the selection, and 'ENTER' to select it. Some menus will have scroll bars, you can use either keys on the scroll bars or the mouse (wich you just place ontop of the part you want to execute and click), the keys are:
Double up arrow icon = to top = ''
Up arrow icon = up one = ''
Down arrow icon = down one = '-'
Double down arrow icon = to bottom = '+'
When there are programs waiting to renew execution the icons of the last three programs run are put on the taskbar, they can be run by either clicking on them or pressing the 'C', 'D', 'E' buttons respectively.
When a message box pops up you can either click anywhere, press 'ENTER' or 'ON'.
When a choose box appears you must either click on OK or CANCEL, the 'ENTER' and 'ON' keys carry out these functions respectively.
Ok, that basically covers all the keys (there is one more, 'PRG').

	The menu options are basically self explanatory except for:
	HP-mos
This is a program to allow you to see the stack without having to exit HP'98
	Control->Desktop->Reset
This option is for use when if you pressed say, 'Delete' and then changed your mind then the next desktop icon selected would be deleted, this resets and then the next desktop icon will be simply run.
	Tasks->....
This will bring up what you can do with the running tasks, you can either 'Run' them, 'Close' them or review their 'Stack'. Whatever you choose will be carried out on the task you MAY select in the next menu, which should be the active tasks (if there are any) (from here you may also select and 'Run'/'Close'/'Stack' tasks not in the taskbar) and any tasks you may select from the taskbar until it is set again to something else.
One more thing, HP'98 is designed for UFL (small font), however it can also use the internal font if UFL is not installed (I recommend UFL, it looks much better).

There are a couple of special commands in HP'98 to multitask, you CANNOT multitask within a BRCH statement (any IF THEN.... or CASE THEN.... or WHILE REPEAT.... etc.). There are three commands you must write EXACTLY and as NAMES (ID's, type 6, etc.) for this:
ITGet&Set
This command checks if the number on stack is NOT a zero, if it isnt then it gets the object (must be a real number) after the command, sets the execution index (which is the command that HP'98 is executing at the time) to that object and executes SetIndex.
ITSetIndex
This command checks if the number on stack is NOT a zero, if it isnt then it executes SetIndex on the next number on stack, if it is then it drops the next number on stack and carries on.
SetIndex
This command alters the point at wich execution is, it will add the number on the stack to the execution index (can be both, a -ve or +ve, go back by ... or go forward by ... respectively).

For Example:
Try this program as a desktop shortcut or something:

DATE TIME TSTR 1 DISP KEY 'ITGet&Set' 3 -100 'SetIndex' DROP

What will this do?
The first part is easy, it will display date and time on the first line and check if a key has been pressed, if it has then it will advence the execution by 3 to DROP and finish the program, if it has not then it will skip the 3 and reset the index of execution back by 100 steps, clearly there is not 100 commands here, but if you go -ve the execution will restart at the first command, if on the other hand you overdo it the other way the program will terminate.
So, what this should do is update the date and time and display it until a key is pressed (other than 'ON', this will minimize the program).

So, with a little imagination i think this should suffice for ANY program you can imagine, if you have problems making a particular loop send me an Email, it may be that thanks to you there will be another multitasking command!

As for OLDtoMPR, simply run it once, once it is finished delete it.
As for Default.SND, simply put it on stack and use 'Restore' from DP'98.
DP'98 is for advanced users, however most users will find 'Custum', 'Backup' and 'Restore' usefull, if there is enough demand on their own for these I will create a lib of them.

Ok, that is it for HP'98 MPR, now for DP'98 (remember: -> is the right arrow character!)

This is version 1.1, and it isn't a beta, however it may still have bugs. ONLY USE IT WITH "HP'98 MPR V1.1 (beta)" OR ABOVE (UNTIL A NEWER VERSION MAY BE READY). YOU HAVE BEEN WARNED.
	Some of the programs in DP'98 will only work while HP'98 is running, since HP'98 creates lambda variables wich it uses itself in some programs.

DP'98 commands are:

WinApp: Creates an HP'98 application, with mouse motion, custum keys, custum display, etc.
Takes 5 arguments from the stack:
5: List in menu format, this will be the application menu.
4: Program to update application display.
3: Program to handle application errors.
2: Program to handle custum key inputs as described later.
1: Program to return a real number, when it is NOT zero WinApp terminates.

Comp98: A compiler for DP'98 commands and some usefull commands.
Simply write a program normally, but to include one of the following commands in your program write them EXACTLY (upper and lower case letters) and as TEXT.
"DSPmen" display menu
"menOFF" menu off
"B->I" binary to intiger
"I->B" intiger to binary
"WinApp" WinApp
"HPmos" HP-mos
"MOUSE" 
"PLAY" Play
"->XLIB" ->XLB.HP98
"MXC" mouse x coordinate
"MYC" mouse y coordinate
"CHOOSE" Choose
"MSGBOX" MsgBox
"MENU" Menu
"MinM" MinM
"$->G" $->grb
"G->D" G->LCD
"GKMM" GKMM

GCIA: gets a Comp98 command program

$->grb: string to grob (UFL1 if installed)

G->LCD: grob to display, on stack: the grob, two real numbers, x and y respectively (remember: upper left corner is x:0, y:0 and lower right is x:130 and y:63)

Choose: choose Yes/No, on stack: a string

MsgBox: message box, on stack: a string

MsCoor: returns the mouse coordinates

->MsCoor: stores the mouse coordinated (must be in the format MsCoor gives them), this could be used to 'snap' the mouse

Menu: Creates an HP'98 menu, takes five arguments from stack:
5: List containing names as strings
4: List containing programs to evaluate respective to names
3: Real, bottom line position
2: Real, start line position
1: Real, length of menu

MinM: same as menu, but use it if a command calls a menu from a menu (to minimize memory usage)

Play: play sound file (list on stack)

HPmos: HP-mos

GKMM: get key and move mouse, this waits for a key and moves the mouse if it is a mouse key, otherwise it returns the key number in the format that WinApp returns the key number for custum keys

->XLB.HP98: makes an xlib for HP'98 out of a number on the stack USE WITH MUCH CAUTION!

Custum: lets you custumize HP'98, the menu works like a var menu, one shift stores, the other recalls and no shift executes.

Backup: Just that.

Restore: Just that.



I know this isnt exactly clear, but with a bit of practice...
Enjoy!

Samuel Mathieson