w32split ignores delimiters in bracketted section

new topic     » topic index » view thread      » older message » newer message

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

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu