26.06.99

Library 500: STRG v1.1
by Yoann DESIR
e-mail: YoannDESIR@yahoo.com
URL : http://www.multimania.com/ydesir/hp48gx/english.html

This library contains a few home-made utils working on strings.

T5C: Takes as argument a string at level 1. Virtually cuts it into pieces of 5 quartets, and ables you to read it as if it was set in lines of 10 blocks of 5 characters.

REPLS: Program of string replacement. Needs a string at stack level 3 in which replacements are made, a pattern string at level 2, and a string at level 1 used to replace all events of string level 2 inside string level 3. Inside string level 2, the ASCII character n°127 means "any character". The number of replacements is given back at level 1 and the possibly modified string is left at level 2.
Only disadvantage: using REPLS often needs more memory than it should; I'm trying to fix that.

REVS: The most faster and smaller version I've found of that program, which reverses the string provided at level 1

CKSMS: Gives the CheckSums of the content of the string level 1, block of 50 characters by block of 50 characters.
This program and the two following are mostly useful when you don't have any possibility to transfer files from a computer and you want to write down small programs under their binary form.
CKSMS allows to make secure typing again the content of the written object. ( cf infra )

CHK: Checks the list of binaries of level 2 ( supposed to be the same as the one given by CKSMS ) describes the checksums of the content of the string at stack level 1.
Each binary must be identical to the CRC of the sequence of 50 characters it is related to.
In case of typing mistake, the stack left by CHK may be used as an argument by EDIT LINE.

EDIT LINE: Must be launched in case of typing mistake detected by CHK: don't modify the stack, and press the icon for the "EDIT LINE" XLIB name. Allows you to edit the line where the the (first) error was detected. By pressing [OK], [ENTER] or [ON], you valid the corrected line (or not), which is then integrated into the original string.

----> Typical example of use of CKSMS, CHK and EDIT LINE:
- Write down the quartets of a created object;
- Get the ChkSums by CKSMS, and write them near;
To get the object in a secure way,
- Type in the written quartets of that object;
- Enter the ChkSums belonging to the different blocks of 50 characters, under the form of a list of binaries;
- Check the conformity of the string before compiling it with CHK;
- In case of mistake, use EDIT LINE to correct the string.

O->ST: Includes the level 1 object in a new string which contents is exactly the same as the quartets of the object provided.

Ex.: 1: 'A'       => 1: "H." 
        84E201014       C2A20 E0000 84E201014 

S->OB: Reciprocal operation. Becareful, any string shouldn't be used as an argument.

COM2S: Compairs two strings at levels 1 and 2. In case of identity, no result is left on the stack. In case of the two strings are different, the position of the character which isn't the same in both strings is left on level 1.

GTDF: From the stack result of COM2S when the two strings are different, sends back at level 2 and 1 the two characters differing in the original strings.

SCAN STR : Allows to limit the number of words per line in a string given at level 1. If several words are more than 22 characters long, the end-of-line words are put in the next line.
If an alinea is encountered in the next line, a new line is created.

STCRC: Calculates the CRC of the quartets CONTAINED in the string at level 1.
Ex.: C2A20 F0000 11920 50000 at level 1 => <4AD7h>, where #4AD7h is the Crc of the quartets <11920 50000>.
Let's try to execute BYTES on the system binary <5h>, which quartets are just <11920 50000>...

Here you are, for any further information, send me an e-mail...