Problem with String.Count[]
Posted: Sat May 08, 2004 4:22 am
edit: on second thought, I should download Service Pack 6 first then see if this bug still exists
edit2: still freezes
In a script I'm writing which auto-invites people to a channel based on names in an .ini file, I used String.Count[] and it froze EQ each time:
I was basically trying to count the number of entries in the .ini file by using Ini[], which I tested returned a string of a format "key|key|key||" when I omitted a key parameter and just passed a section. I wanted to count the number of | characters to calculate the number of entries in a section.
My first thought was that maybe the | character was causing a parsing error since it's a comment delimiter, but then I tried:
.. which should return 2 (2 L's in Hello?) but that froze EQ too. Anyone else having this problem?
edit: an addendum to this, my initial method of reading a variable-line-length .ini file was using String.Arg[] until it returned NULL but I'm not sure how to test if a string variable is NULL. How do I do that?
edit2: still freezes
In a script I'm writing which auto-invites people to a channel based on names in an .ini file, I used String.Count[] and it froze EQ each time:
Code: Select all
Sub LoadInviteList
/declare ListSize int 0
/declare ListData string
/varset ListData ${Ini[InviteList.ini,names,,]}
/echo ${ListData.Count[|]} occurences
| more code follows...
/return
My first thought was that maybe the | character was causing a parsing error since it's a comment delimiter, but then I tried:
Code: Select all
/echo ${String[Hello].Count[l]}
edit: an addendum to this, my initial method of reading a variable-line-length .ini file was using String.Arg[] until it returned NULL but I'm not sure how to test if a string variable is NULL. How do I do that?