Subj : Final code
To : Sean Dennis
From : mark lewis
Date : Sat May 08 2010 12:24 pm
ml> here's another post that only pulls out the space delimited fields and
ml> this one is zero-based... field 0 is 'A', 1 is 'Daryl', 3 is the comma
ml> delimited section and so on...
SD> Thanks for the code; I'll keep it in my archives.
:) i've quite a large lib of raw sources that i have to dig thru from time to
time... i've forgotten over half of what i have and a lot of it is old, too...
like 1992 PASCAL echo postings... i've several from DJ Murdoch and a few other
"old timers" from that period ;)
SD> I don't normally post my code "out in the open", but I only think
SD> it's right since it's based on what you did. I need to do a bit
SD> more error checking in this code. You'll see calls to functions
SD> that I use in my doorkit unit, but I think you'll get the jist of
SD> it:
looks good! maybe a few suggestions?
SD> ===Cut===
[trim]
SD> ((Str[I] = #32) Or
SD> (Str[I] = #9) Or
SD> (Str[I] = ':'))) Do
these were originally ';' (semicolon)... i'm not sure (off hand) what they are
specifically used for but there is other code in ExtractWord that specifically
looks for and includes it in the string...
SD> Count := 2;
SD> { Read in the first name and last name then concatenate
SD> together for FKFOSSIL }
from here
SD> TempData := '';
SD> TempData := ExtractWord(GTStr, Count);
SD> Inc(Count);
SD> TempData := TempData + ' ' + ExtractWord(GTStr, Count);
SD> fk_Client.Name := TempData;
to here
change to
saves three moves of data back and forth ;) i would probably also just use the
numbers in the ExtractWord calls instead of messing with the count var...
SD> Inc(Count);
SD> { Determine if ANSI is used or not }
SD> TempData := ExtractWord(GTStr, Count);
TempData := ExtractWord(GTStr,11);
SD> If (TempData = 'ANSI') or (TempData = 'RIPSCRIP') Then
SD> fk_Client.ScreenType := 1 Else fk_Client.ScreenType := 0; {
//i think// this one can also be done as a boolean on one line... but i forget
if true is one or zero...
fk_Client.ScreenType := ((TempData = 'ANSI') or (TempData = 'RIPSCRIP'));
but i may be getting that mixed up with another language :/ if not, it might
even be possible to put the calls to ExtractWord in there and forego the use of
TempData completely...