1. w32split ignores delimiters in bracketted section
- Posted by marky1124 Nov 13, 2008
- 923 views
Hi,
It's recently come to my attention that the w32split() routine that comes with win32lib will ignore occurrences of a delimiter which are contained within a ( or { bracketted section when called with an atom delimiter, e.g.
include win32lib.ew sequence lData, lData2 lData = "Fi(eld1\nField2" puts(1, "Split using 10\n") lData2 = w32split(lData, 10) puts(1, "----------------------------------\n") for x = 1 to length(lData2) do puts(1, lData2[x] & "\n---------------\n") end for puts(1, "\n\nSplit using {10}\n") lData2 = w32split("Fi(eld1\nField2", {10}) puts(1, "----------------------------------\n") for x = 1 to length(lData2) do puts(1, lData2[x] & "\n---------------\n") end for
Produces
Split using 10 ---------------------------------- Fi(eld1 Field2 --------------- Split using {10} ---------------------------------- Fi(eld1 --------------- Field2 ---------------
The documentation mentions this behaviour with reference to braces { } but doesn't mention that it applies to ( brackets ) as well. Please could the documentation be updated, perhaps from this....
Note 1 - if pDelim is an atom and not equal to '{' then sections of text enclosed in matching '{' and '}' are not scanned.
to this...
Note 1 - if pDelim is an atom and not equal to '{' then sections of text enclosed in matching '{' and '}', or '(' and ')', are not scanned.
Cheers,
Mark
2. Re: w32split ignores delimiters in bracketted section
- Posted by marky1124 Nov 13, 2008
- 929 views
Whoops - please ignore the typo in the 2nd w32split which has the string instead of the lData variable. It doesn't alter the example, it's just misleading. If I could edit the post I'd correct it.