1. strtok-v2.e addition
- Posted by Kat <gertie at PELL.NET> Jul 13, 2002
- 384 views
sorttok() is added now: string = {"Red,Skelton,45,London,England", "Lucy,Ball,56,Barre,North Dakota", "Fred,Astaire,45,Alberta,Canada", "Pierre,du Pont,56,Paris,France"} string = sorttok(string,{3,-2},',') -- sort by field3, then by reverse field2 string = {"Red,Skelton,45,London,England", "Fred,Astaire,45,Alberta,Canada", "Pierre,du Pont,56,Paris,France", "Lucy,Ball,56,Barre,North Dakota"} Kat
2. Re: strtok-v2.e addition
- Posted by Kat <gertie at PELL.NET> Jul 13, 2002
- 400 views
On 13 Jul 2002, at 8:32, Kat wrote: > > sorttok() is added now: > > string = {"Red,Skelton,45,London,England", > "Lucy,Ball,56,Barre,North Dakota", > "Fred,Astaire,45,Alberta,Canada", > "Pierre,du Pont,56,Paris,France"} > > string = sorttok(string,{3,-2},',') > -- sort by field3, then by reverse field2 > > string = {"Red,Skelton,45,London,England", > "Fred,Astaire,45,Alberta,Canada", > "Pierre,du Pont,56,Paris,France", > "Lucy,Ball,56,Barre,North Dakota"} sortntok() is also working now. Question: what is the best way to rename these for case-insensitivity?: parse deparse matchtok matchntok wildtok wildntok findtok gettok addtok puttok / changetok reptok / repltok sorttok instok istok remtok deltok sortntok Kat
3. strtok-v2.e addition
- Posted by Kat <gertie at PELL.NET> Jul 14, 2002
- 389 views
Ok, since i recieved no feedback on adding case-insensitivity to the strtok library, i am adding it like this: string = "a1 cat1 ba Cat1 da tac2" findtok(string,"Cat1",{1},32) = 4 findtok(string,"Cat1",1,32) = 4 findtok(string,"Cat1",{"i",1},32) = 2 This makes the flag optional and doesn't break anything. So far, matchtok, matchntok, wildtok, wildntok, and findtok can ignore the case of token and string. Webpage and zip file are updated. Comments are welcome. Kat http://www.pell.net/warning/euphoria.html
4. Re: strtok-v2.e addition
- Posted by Robert Craig <rds at RapidEuphoria.com> Jul 18, 2002
- 392 views
Kat writes: > Rob, how much time is spent on type checks? User-defined type-checks involve a subroutine call and usually a couple of comparisons. If you say: without type_check they won't happen. If you are worried about performance, you should try: with profile or with profile_time to see where the bottleneck really is. It's quite often not where you expect. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com
5. Re: strtok-v2.e addition
- Posted by petelomax at blueyonder.co.uk Jul 19, 2002
- 378 views
{{{ On Thu, 18 Jul 2002 19:47:01 -0400, Robert Craig <rds at RapidEuphoria.com> wrote:
User-defined type-checks involve a subroutine call
and usually a couple of comparisons. If you say:
without type_check
they won't happen.
and usually a couple of comparisons. If you say:
without type_check
they won't happen.
DOH! AGAIN! I seem to be always repeatedly frightened off using Eu types 'cos I stupidly forget you can switch the (obvious) performance hit off once it all works.
It is a pretty cool concept though, I remember in the decipher contest coding a result type (or five) which trapped the program at near enuf the exact point it made a mistake...
(And yes, I remember hacking thru the code at 2am taking it all out..) </DOH> </AGAIN>
Pete