[Gambas-user] Select Case problem
Bruce
bbruen at ...2308...
Thu Mar 28 07:35:10 CET 2013
Hi,
I am trying to parse a text file that contains key,value pairs like:
Name=Malarky
Size=10
BackImage[N]=sometext
FrontImage[S]=sometext
etc
using a construct like
For idx = 0 to sourcearray.max
Select Upper(Split(SourceArray[idx],"+")[0])
Case "NAME"
blah blah
Case "SIZE"
blah blah
Case Like "BACKIMAGE[*]"
blah blah
Case Like "FRONTIMAGE[*]"
blah blah
End Select
Next
This fails because Case Like "BACKIMAGE[*]" is being interpreted as a
regular expression where I need to escape the regexp "[]" meaning.
Trying to use escapes like
Case Like "BACKIMAGE\[*\]"
fails as \[ is an unknown escape sequence.
Any clues?
tia
Bruce
More information about the User
mailing list