1. Error in manual for 'split' command

The manual entry for the 'split' command seems to have parameter 4 described as out by one.

Paramater 4 for this command says "limit : an integer (default is 0). The maximum number of sub-sequences to create. If zero, there is no limit."

The example given is:

result = split("John,Middle,Doe", ",",, 2) -- Only want 2 sub-sequences. 
-- result is {"John", "Middle,Doe"} 

That example actually gives:

-- result is {"John",  "Middle", "Doe"} 

To get the desired result we would need to code:

result = split("John,Middle,Doe", ",",, 1) 
-- result is { "John", "Middle,Doe"} 
new topic     » topic index » view message » categorize

2. Re: Error in manual for 'split' command

Yikes:

eu40 said...
public function split(sequence st, object delim=' ', integer limit=0, integer no_empty = 0) 
eu41 said...
public function split(sequence st, object delim=' ', integer no_empty = 0, integer limit=0) 

Whappen there?

Pete

new topic     » goto parent     » topic index » view message » categorize

3. Re: Error in manual for 'split' command

petelomax said...

Yikes:

eu40 said...
public function split(sequence st, object delim=' ', integer limit=0, integer no_empty = 0) 
eu41 said...
public function split(sequence st, object delim=' ', integer no_empty = 0, integer limit=0) 

Whappen there?

Pete

http://scm.openeuphoria.org/hg/euphoria/rev/c3394915cf89

Where did you get your eu40 version from? That's old. This was changed before the first release candidate (4.0.0rc1) was put out in Nov 2010 and all official non-beta releases of 4.0 have the "eu41" version.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu