[Gambas-devel] gb3 Split() problem

Kadaitcha Man nospam.nospam.nospam at ...176...
Mon Jan 4 13:47:42 CET 2010


2010/1/4 Benoît Minisini <gambas at ...1...>:
>> 2010/1/4 Benoît Minisini <gambas at ...1...>:
>> > Yes, I have added an explicit warning to the Split documentation, as
>> > apparently it was not clear enough.
>>
>> Ok, I don't have an issue with that because I can deal with it, but
>> about this...
>>
>> StringArray = Split ( String AS String [ , Separators AS String ,
>> Escape AS String , IgnoreVoid AS Boolean , KeepEscape AS Boolean ] )
>>
>> I will change "Separators AS String" to "Separator AS String", in
>> accordance with what the UI actually says.b
>>
>> I will also fix this, which uses two characters:
>>
>> Elt = Split(" Gambas Almost Means BASIC  !\n'Do you agree ?'", " \n", "'")
>>
>> " \n" is wrong.
>
> No, you can have several different separators. Each character in the
> "Separators" is a possible separator. This is the reason why Separator is
> written in the plural.

I'm sorry, Benoit, but if you if you allow more than one character as
a separator then the failure to correctly deal with "\r\n" looks like
a bug to me.

I'm not trying to be difficult here, but really, "\r\n" is just as
much a sequence of ASCII characters as is "aZ". And by what you just
said, "||" should result in a clean split without voids, but it most
certainly does not. Look at the attached code. If the text uses "||"
as the separator then the Split function returns voids for the second
bar. The separator is singular, no two ways about it.

To put it another way, again without being rude, your answer does not
match the facts.

>> I will also simplify the example:
>>
>> Elt = Split(" Gambas Almost Means BASIC  !\n'Do you agree ?'", " \n", "'")
>>
>> The control characters, question marks. and exclamation marks make it
>> extremely difficult to immediately understand that the separator is
>> singular.
>>
>> Are you ok with that?
>>
>> Regards,
>>
>
> You can add simpler examples, but do not remove the complex ones, are AFAIK,
> they are correct.

IMO, not a single one of the examples are correct based on the facts.
Anyway, we still have issues to sort out before I get to changing the
documentation, squire :)

Regards,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot.png
Type: image/png
Size: 5585 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20100104/be86bfee/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SplitTest2.tar.gz
Type: application/x-gzip
Size: 8847 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20100104/be86bfee/attachment.bin>


More information about the Devel mailing list