DIRLEX - HP-71 BASIC extensions, various authors, combined into a single LEX file by Mike Markov. LEX file : DIRLEX -- VER$ is " DIRLX:A" Documentation : None on SWAP07. Source code is 50Kbytes. See source code for earlier version of DIRLEX on CHHU06, Sam Chau's BURNLEX on CHHU04. Keywords include FKEY, to be eliminated as it is now in JPCLEX, and MAPKEY$ and VELIST and CURS$, which are part of the VE71 package. Includes a poll handler to allow the HP-71 to recognize HP-41 & HP-75 file types by J.G.Buitenhuis. Description: This LEX files provides the following keywords: 5E/C1 BINCOMP$($) Sam Chau, BURNLEXS. Same as COMP$ in GRAPHLEX. 5E/C2 CHIRP John Baker. Special error warning noise. 5E/C3 COUNT($,$) Tapani Tarvainen, CHHU06, file COUNTLXT. 5E/C4 CURS$(#,#,?#) VE71, S.Piccardi, S.Tendon, cursor positioning Parms are row #, col #, max col. 5E/C5 DT2DOT$($,#,#) DOT2DOT$, F. Lipchultz, CHHU Chhronicle. 5E/C6 ESCP$($) Old ESC$, M.Markov. See ESCPS on SWAP07 for newer version. 5E/C7 HEXTOA$($) M.Markov. Standard HEX conversion, "4142"=>"AB" 5E/C8 HEX$($) M.Markov. Standard HEX conversion, "CD"=>"4344" 5E/C9 INHEX$($) M.Markov, similar to HEX$, embeds protected spaces between bytes. 5E/CA MMTYPE$($) J.G. Buitenhuis. converts the 2 mass storage file type bytes into recognizable form.. 5E/CB FKEY Now part of JPCLEX, in support of VE71 5E/CC FROUND(#,?#) Marco de Vries, CHHU Chronicle. Round # to ?# digits. default ?# is display setting. 5E/CD GETNIB(#) Nick Reid, CHHU Chronicle, returns nib at address # 5E/CE MAPKEY$($) VE71, see below 5E/CF MAP$($,$,$) Tapani Tarvainen, see below. Now part of JPCLEX. 5E/D0 MAP Tapani Tarvainen, see below, also part of JPCLEX. 5E/D1 STRSUM($) Sam Chau, BURNLEXS from CHHU04 5E/D2 TXT$($) J.G.Buitenhuis - inverts nibs: "142434"==>"414243" input parm must be length 2*n, HEX code! 5E/D3 VELIST see below ****************************************************** STITLE DOT2DOT LEX - Fred Lipschultz [106] CHHU V2N7 * * DT2DOT$ forms the bit patterns used to generate faster ThinkJet graphics * with the latest versions of the DOT2DOT program. * * SYNTAX: DT2DOT$( string, bit #, stretch factor) where: * -- string is a set of bytes such as obtained by GDISP$ or PATTERN$ * -- bit # , from 0 to 7, is the display character row from top to bottom * of string * -- stretch factor is the number of times each bit is duplicated in the * bytes output * * Example: DT2DOT$(PATTERN$('A'),0,3) should return the following bit pattern: * 000111111111000000000000 * Note that unused bits on the rightmost side of DT2DOT$ are zero- * filled, ie. the function left justifies. * Note that PATTERN$ is six times longer than 'string' and that the * resulting DT2DOT$ will be longer by the stretch factor * * -- the absolute value of the stretch factor is used, zero defaults to 1 * -- to maintain proportions, send each DT2DOT$ to the Thinkjet * CEIL(stretch factor/2) times ********************************************************* STITLE HEXLEX7, utilities, M Markov <86/08/20> ** Based on DESALS -- JPC25 by M. Martinet * * 'ESCP$' Syntax: ESCP$(A$) ==> CHR$(27)&A$[1,1]&CHR$(27)&A$[2,2]&.. * * 'HEXTOA$' Syntax: HEXTOA$("414243....") ==> "ABC..." * * 'HEX$' Syntax: HEX$("ABC...") ==> "414243.." * * 'INHEX$' Syntax: INHEX$("ABC...") ==> " 41 42 43 .. .." * (with protected spaces 1B3C201B3E hex) * *************************************** * * ESCP$ provides a short-hand for writing CHR$(27)&"T". Instead, * use ESCP$("T"). This function is especially useful with video * interfaces, since most escape sequences consist of a single * character parameter. Thus ESCP$("ACACAC...") will move the cursor * three spaces to the right & three spaces up. * This is most convenient for inserting or deleting lines, backspacing, * scrolling up or down. * Proposed enhancement: ESCP$(A$[,N]), where the optional numeric * parameter would provide the equivalent of RPT$(ESCP$(A$),N). (Future) * HEXTOA$ and HEX$ provide handy ASCII <==> hexadecimal conversions * WITHOUT reversing the order of the nibbles, unlike other similar * functions such as ATH$ and HTA$. This has many advantages when * converting mass storage pointers to decimal, since it lets you use * HTD and DTH$. This is far faster than any equivalent BASIC routine. * Among other applications, it should allow translation of BAR75, * an HP-75 program for printing HP-41 barcode. * * INHEX$ is intended for use with a full-screen editor. It greatly * speeds up any program that implements byte level editing with * protected field separators, for those of us who invariably make * mistakes keying-in LEX files from LHEX listings... * CAUTION: Because INHEX$ imbeds a vast quantity of display control * codes into its output, WIDTH should be set to INF. WIDTH, WINDOW, * SCROLL and final cursor position interact to produce some strange * results. * *********************************************** * * Tapani Tarvainen 86/09/10 * * Function COUNT(,) * returns the number of times occurs in * must be single character * * E.g., COUNT("abracadabra","a") = 5. * * Function MAP$ maps given set of characters onto another * in a string; statement MAP does the same for * an entire TEXT (LIF1) file. * * Syntax: MAP$(,,) * MAP ,, * where , and are string expressions * and is a file specifier (literal or string expr). * * The file must reside in RAM and it mustn't be secured; * the strings and must be of equal length. * If some char occurs several times in , * it's the first one that counts. * * For example, MAP$("calculator","ac","xz") returns * "zxlzulxtor", and * MAP F$,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ" * will convert entire file F$ to upper case. * * Errors: * Invalid Filespec, File Not Found as appropriate; * Invalid File Type if non-TEXT file; * Illegal Access if not in RAM; * Protected if SECUREd; * Invalid Arg if LEN()#LEN(); * Insufficient Memory results if there isn't enough * room for the conversion table (256 bytes, see below); * End of File means the file is bad (record length points * beyond end of file). * * Algorithm: Create a 256-byte table, where Nth byte * is the new value for char N, and replace every char * in the file with corresponding element in the table. ** CUR$(,[,]) ** ** where , and are in the ** range 0-255. ** ** The CUR$ string is equivalent to: ** ** CHR$(27)&"%"&STR$()&STR$() ** ** If the optional parameter is given, ** the CUR$ string is equivalent to: ** ** CHR$(27)&"%"& ** STR$(+ DIV )& ** STR$( MOD ) ** ********************************************************** ** Purpose: Map key to a unique one-byte code, and return ** code in a one-byte string. ** ** Syntax: MAPKEY$() ** Algorithm: ** ! K$=KEYWAIT$ ** if K$ is longer than a byte ** get keycode of K$ ** case (keycode) ** null string : return (null string) ** unshifted key : return (keycode + 90) ** f-shifted key : return (keycode + 112) ** g-shifted key : return (keycode) ** endcase ** else if is_alfa (K$) return (toggle_case (K$)) ** else return (K$) ********************************************************** ** VELIST #,, ** ** NOTE: and may be ** variable expressions. **************************************************