🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sources.hp48
Article #4

v06i011: find2_gr - Binary search function for Roldx 4.X v1.1, Part01/01

#4
From: Glenn Robertson
Date: Wed, 29 Jul 1992 01:16
104 lines
4755 bytes
Checksum: 1936534245 (verify with brik -cv)
Submitted-by: Glenn Robertson <73117.675@CompuServe.COM>
Posting-number: Volume 6, Issue 11
Archive-name: find2_gr/part01


BEGIN_DOC find2.doc
The following program is intended to be used with Jim Weisbin's Roldx 4.X
(both version 4.0 and 4.1) "rolodex" program.  The program allows 
relatively fast searches of any size file from with the main RLDX
program.  Test searches on a file with 90 records (10,990.5 bytes)
indicate that any record can be accessed in just over one second.  In
theory, larger files will not change this time appreciably.

This program is provided with Jim Weisbin's permission.

Two versions of the program are included: 1) find2.UUE; and 2) find2.ASC.

Instructions -

1) find2.UUE - UUDECODE and download into the ROLDX directory as 'find2'.

2) find2.ASC - Download and covert using ASC->.  Save as find2 in the
ROLDX directory.

Next - modify ROLDX by adding the following to the CASE statements:

       CASE { 25.1
34.1 26.2 } x POS
. . .
       END x IP 52
SAME
       THEN edit
       END x IP 53      <--- this
SAME                    <--- is
       THEN find2       <--- new
       END {54 85
. . .

These commands will make the binary search function accessable by pressing
key 53 ("EEX").  As many characters as you like can be entered, however, 
the search only compares the first letter entered.  The list searched
must be in ALPHABETIC ORDER for this function to work correctly.

During execution of the binary search (ie., once the EEX key has been
pressed) you will be prompted for the text to find.  Any number of
characters can be entered, however, the search is only on the first
character.  If an incorrect entry is made, all characters can easily be
erased by pressing the ATTN key. If no characters are present and the
ATTN key is pressed, the function will abort and return to ROLDX at
previous position.  An advantage of inputing more than one character when
using this function is that it allows a fast initial search using the 
binary search and a "first" character hit, and then a more detailed
sequential search using the ROLDX's 'find' (alpha key) function.
Additional characters are automatically saved.

'find2' performs a variable check and the following variables must be 
present and be of the correct type before it proceeds: rdNAME, rdSIZ,
rdPOS, and rdTXT.

The function seems to work without any problems, however, as this is my 
first attempt at a system RPL program, I recommend that you backup your
HP48 before running it.  Checksum # 17084d, 386 bytes.

Hope you find this useful!

Glenn Robertson (Compuserve 73117,675) - comments are welcome!
END_DOC


BEGIN_ASC find2.asc
%%HP: T(3)A(D)F(.);
"D9D2051A81E5E40D9D209FF3030040D0040710401204047A2003D4303D4303D4
303D4303D43B21300D47084E20602746E414D454C2A20F00006496E646A3FD55
04CA364CA369E5509FF300CA30FEF3044F248DA16D9D204B2A20E51684E20502
7463594A584E2050274605F43584E20502746458545A7B8121F811192031135D
9D20852300F51652616881306B3167E316479A2DB056CB9A2DB056479A206FA2
2A1709FF307E3166B3167F4910ED304EC30EE170D9D20D9D208813000616AEC8
1C9B261192010000C9B26DE05088130C57465161615A50C5416DE05015A50B05
91178A28DA16D9D20E04160E516B2130D9D20E04160F516B213084E20602746E
414D4546B3167E316479A2DB056CB9A2DB056479A206FA2B2130B21305E17079
E6084E2050274605F4353158185230C541679E6084E205027464585453158179
470B2130B2130D9D204423079470B2130B21308BE40D9D20C2A20320000527F6
365646572756021424F4254558B2127F0679470B2130B2130CB24"
END_ASC

BYTES: #42BCh 376.5

BEGIN_UU find2.uue
begin 644 FIND2
M2%!(4#0X+42=+5"A&%Y.T-D"^3\P``0-0'`!!"%`0*<",$T#TS0P30/3-#!-,
MLQ(#T'2`Y`(&<F1.04U%+"KP``!&:6YD.M]50*QCQ#J67@7Y/P"L`^\_0/1"%
MV!K6V0*TH@)>84@N4"!'-I6DA>0"!7)D4$]32"Y0($=&A46EMQ@2CQ&1`A,Q&
MU=D"6#(`7V$E%H88`[83=CYA=*G2"V6\J=(+972I`O8JHG&0_P/G$V8[8?>4,
M`=X#Y#S@'@>=+=#9`H@Q`&!AZHS!N6(1*1```)PKU@X%B#'`=605%A:E!5P4U
MU@X%45JP4!EQJ(*M89TMX$!AX!6V$@.=+>!`8?`5MA(#2"Y@($?F%-149#MA;
MYQ-&ERJ]4,:;*KU01I<J8*^R$@,K,5`>!Y=N@.0"!7)D4$]3$X6!)0-<%';I-
M!D@N4"!'1H5%-5$8EW2P$@,K,=#9`D0R<$D'*S&P$@.X3M#9`BPJ,`(`4')OM
98V5D=7)E($%"3U)4A2LA]V"7=+`2`RLQ`"LQ5
``
end
sum -r/size 47150/566 section (from "begin" to "end")
sum -r/size 7683/385 entire input file
END_UU
Technical Details
Message-ID: <1992Jul29.011603.22577@seq.uncwil.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!seq!spell

Show Full Headers
Complete Article Headers
Newsgroups: comp.sources.hp48
Path: arc1-ca.pugleaf.net!sparky!uunet!seq!spell
From: Glenn Robertson <73117.675@CompuServe.COM>
Subject:  v06i011:  find2_gr - Binary search function for Roldx 4.X v1.1, Part01/01
Message-ID: <1992Jul29.011603.22577@seq.uncwil.edu>
Followup-To: comp.sys.hp48
Sender: spell@seq.uncwil.edu (Chris Spell)
Organization: Univ. of North Carolina @ Wilmington
Date: Wed, 29 Jul 1992 01:16:03 GMT
Approved: spell@seq.uncwil.edu
Lines: 108