Adding 'separator' parameter to str_parse

Posted By: Clemens

Adding 'separator' parameter to str_parse - 04/05/10 15:24

Hi Conitec/JCL,
what about adding the parameter 'separator' to the new (beta) str_parse function? -> making it possible to decide, which character (instead of only space) is used for separating the words.
With this it would be really easy to simulate the wished str_split, too.
Greetings, Clemens

Marginal: What's the criterion for adding a function to the engine dll or to the (strio).c?
Posted By: Clemens

Re: Adding 'separator' parameter to str_parse - 09/12/10 20:29

Would like to refocus on this request ... cause I think it has its right to get discussed.

However, I did this small change on my own - but prefer having it general integrated.

One problem seems to be, that the function becomes incompatible with earlier scripts using it, when changing it (->its parameters).

So it's time for having the feature "functions with a variable argument number" ([url="http://manual.3dgamestudio.net/forecast.htm"]forecast[/url]) released...! wink
Posted By: WretchedSid

Re: Adding 'separator' parameter to str_parse - 09/12/10 21:06

I have already opened a thread about variadic functions -> http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=340444#Post340444

While variadic functions can be a really great way to provide a cleaner API for some cases (eg. printf), it's still dirty and should be avoided if possible. In this case the function could be overloaded without any problems.
Posted By: jcl

Re: Adding 'separator' parameter to str_parse - 09/13/10 13:44

We won't add a new function, but will add a global variable for the parse separator.
Posted By: nfs42

Re: Adding 'separator' parameter to str_parse - 05/27/12 15:04

Hi JCL,
is there a global var for this ? probably we could use delimit_str ?
© 2024 lite-C Forums