BBS: Inland Empire Archive Date: 11-13-92 (10:59) Number: 337 From: MICHAEL MALONE Refer#: NONE To: NICOLAS NOWINSKI Recvd: NO Subj: Re: Hi! Conf: (2) Quik_Bas
NN> Hello, NN> My name is Nicolas Nowinski and I would like to welcome Hello! NN> myself to you all. I am a programer in QuickBASIC 4.5 and NN> use PDQ, PBClone, BASWiz, LibWiz, and Some Other Ahhh just the person I need to ask a question of. Are you familiar with the FindT function of PDQ? Here is whats relevent: DECLARE SUB FindT (BYVAL Segment%, BYVAL Address%, Elsize%, NumEls%, Search$) Here is a code snippet: TotalCount = 0 'Set initial Value Fcnt = FCount(Fspec$) 'Set Value to the value Fspec returns. TotalCount = TotalCount + Fcnt 'Add to the accumulator DIM FArray(Fcnt) AS STRING * 12 'Dim array accordingly DIM MArray(Fcnt) AS STRING * 12 'Dim array for numerical order ' ReadFileT Fspec$, VARSEG(FArray$(0)), VARPTR(FArray$(0)) 'read the names ' X% = 1 Cnt = 0 Start = 0 Size = Fcnt Elsize = 12 Elements = Size ' PRINT "Ordering Messages:" ' DO WHILE Cnt < Fcnt Elements = Size Search$ = QPLtrim$(STR$(X%) + ".MSG") FindT VARSEG(FArray$(Start)), VARPTR(FArray$(Start)), Elsize, Elements, Search$ IF Elements <> -1 THEN Cnt = Cnt + 1: X% = X% + 1 ' Increase both MArray$(Cnt) = Search$ ' Put our find into an array ELSE IF Elements = -1 OR Start + Elements > Size THEN X% = X% + 1 END IF END IF LOOP This works fine, except for one small problem. It returns sucess when it finds a partial match for instance, if I want it to search for the non-existant string, 5.msg, it will return sucess when it stumbles across 15.msg. Any ideas? Mike --- Msg V4.2 * Origin: The Migrant BBS *HST* Phx, AZ. (602) 264-2328 (1:114/7)
Books at Amazon:
Back to BASIC: The History, Corruption, and Future of the Language
Hackers: Heroes of the Computer Revolution (including Tiny BASIC)
Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution
The Advent of the Algorithm: The Idea that Rules the World
Moths in the Machine: The Power and Perils of Programming
Mastering Visual Basic .NET