Strange results in deletion of lines

David C. davidocoker at gmail.com
Mon May 10 22:34:49 EDT 2010


Hey folks,
I've run into something weird again (at least it seems weird to me)
and need some help. I have a variable named tHold that contains the
following (targeted) lines of text among many others:

FB460V-CS05
FD620DCS26
FD751VAS00
FE290DDS00
FE290DES17
FE400DES03
FH381VAS29R
FH430VBT25M

What I'm trying to do is to delete any line that begins with "F" and
the working code looks something like this:

put the number of lines in tHold into tCount

  repeat with j = 1 to tCount
      if character 1 of line j of tHold = "F" then delete line j of tHold
  end repeat

For some reason that I cannot detect, it removes only 4 of the eight
potential lines that are targeted although they all clearly begin with
an "F". I've checked and double-checked my sample data to make sure
there are not any spaces preceding the "F" character for each.

Ideas? Better method?

Best regards,
David C.



More information about the use-livecode mailing list