1. Win32Lib Feature Request
- Posted by "C. K. Lester" <cklester at yahoo.com> Jan 22, 2003
- 412 views
Please include this in Win32Lib (if not already!) and tell me where to put it in my own copy... I asked nicely! :) ---- function matchItem( integer List_ID, sequence matchTerm ) This function would return a sequence of item numbers -OR- the items themselves that in whole or part matched the matchTerm. An empty sequence is return when no matches are found. Example: -- myList = {"IADCDAYW.DOT","OTHER.DOT","IADCFOOT.DOT","IADCTURN.DOT"} junk = matchItem( myList, "IADC" ) junk could now equal { "IADCDAYW.DOT","IADCFOOT.DOT","IADCTURN.DOT"} -or, if returning values only, junk could equal { 1, 3, 4 }
2. Re: Win32Lib Feature Request
- Posted by Dan Moyer <DANIELMOYER at prodigy.net> Jan 23, 2003
- 404 views
C.K., I think Derek said he's on vacation? Dan Moyer ----- Original Message ----- From: "C. K. Lester" <cklester at yahoo.com> To: "EUforum" <EUforum at topica.com> Subject: Win32Lib Feature Request > > Please include this in Win32Lib (if not already!) and tell me where to put > it in my own copy... I asked nicely! :) > > ---- > function matchItem( integer List_ID, sequence matchTerm ) > > This function would return a sequence of item numbers -OR- the items > themselves that in whole or part matched the matchTerm. An empty sequence is > return when no matches are found. > > Example: > > -- myList = {"IADCDAYW.DOT","OTHER.DOT","IADCFOOT.DOT","IADCTURN.DOT"} > > junk = matchItem( myList, "IADC" ) > > junk could now equal { "IADCDAYW.DOT","IADCFOOT.DOT","IADCTURN.DOT"} > > -or, if returning values only, > > junk could equal { 1, 3, 4 } > > > > TOPICA - Start your own email discussion group. FREE! >
3. Re: Win32Lib Feature Request
- Posted by "C. K. Lester" <cklester at yahoo.com> Jan 23, 2003
- 374 views
On Wednesday 22 January 2003 09:06 pm, you wrote: > > I think Derek said he's on vacation? Oh. Well, I've got something working for me... I just think it should be=20 standard code. But who cares what I think, right? You people just code al= l=20 day and go on vacations whenever you want!!!! --=20 My Microsoft OS... it's just for games, now.
4. Re: Win32Lib Feature Request
- Posted by gertie at visionsix.com Jan 23, 2003
- 374 views
On 22 Jan 2003, at 14:33, C. K. Lester wrote: > > Please include this in Win32Lib (if not already!) and tell me where to put > it in my own copy... I asked nicely! :) > > ---- > function matchItem( integer List_ID, sequence matchTerm ) > > This function would return a sequence of item numbers -OR- the items > themselves that in whole or part matched the matchTerm. An empty sequence is > return when no matches are found. > > Example: > > -- myList = {"IADCDAYW.DOT","OTHER.DOT","IADCFOOT.DOT","IADCTURN.DOT"} Strtok-v2-1 can find them using various combinations of matchtok, findtok, or wildntok, matchntok, and retrieve them with gettok,, for instance: junk = gettok(myList,wildntok(myList,"IADC*",0,""),"") You can select case-insensitivity for find, get, match, etc, in v2-1 too. > junk = matchItem( myList, "IADC" ) > > junk could now equal { "IADCDAYW.DOT","IADCFOOT.DOT","IADCTURN.DOT"} > > -or, if returning values only, > > junk could equal { 1, 3, 4 } Yep, matchntok or wildntok will do that. Either case-sensitively, or insensitively. the difference is that matchntok is like a wildntok using *IADC*, and you know your match is only at the start of the sequences, so i'd use IADC* in wildntok. If you break up the subsequences into more dotted form, strtok gets even more precise in what you can locate. Kat
5. Re: Win32Lib Feature Request
- Posted by "C. K. Lester" <cklester at yahoo.com> Jan 23, 2003
- 383 views
On Wednesday 22 January 2003 10:01 pm, you wrote: > > > -- myList =3D {"IADCDAYW.DOT","OTHER.DOT","IADCFOOT.DOT","IADCTURN.DO= T"} > > Strtok-v2-1 can find them using various combinations of matchtok, findt= ok, > or wildntok, matchntok, and retrieve them with gettok,, for instance: > > junk =3D gettok(myList,wildntok(myList,"IADC*",0,""),"") The problem is, I have to retrieve the data from myList (the control) fir= st=20 and put it into a sequence... something like this: for t =3D 1 to getCount( myList ) do =09mySeq =3D append(mySeq, getItem( myList , t ) end for junk =3D gettok( mySeq, wildntok(mySeq,"IADC*",0,""),"") If I want to match "IADC" anywhere in the string, I'm guessing I use "*IA= DC*"=20 right? Thanks, Kat! -ck
6. Re: Win32Lib Feature Request
- Posted by gertie at visionsix.com Jan 23, 2003
- 372 views
On 22 Jan 2003, at 22:17, C. K. Lester wrote: > > On Wednesday 22 January 2003 10:01 pm, you wrote: > > > > > -- myList = {"IADCDAYW.DOT","OTHER.DOT","IADCFOOT.DOT","IADCTURN.DOT"} > > > > Strtok-v2-1 can find them using various combinations of matchtok, findtok, > > or > > wildntok, matchntok, and retrieve them with gettok,, for instance: > > > > junk = gettok(myList,wildntok(myList,"IADC*",0,""),"") > > The problem is, I have to retrieve the data from myList (the control) first > and > put it into a sequence... something like this: > > for t = 1 to getCount( myList ) do > mySeq = append(mySeq, getItem( myList , t ) > end for > junk = gettok( mySeq, wildntok(mySeq,"IADC*",0,""),"") but your list is already in a sequence, remember: myList = {"IADCDAYW.DOT","OTHER.DOT","IADCFOOT.DOT","IADCTURN.DOT"} > If I want to match "IADC" anywhere in the string, I'm guessing I use "*IADC*" > right? Or matchtok, matchntok. The way you say myList is set up, you don't even run thru the parse/deparse routines in strtok. Kat
7. Re: Win32Lib Feature Request
- Posted by "C. K. Lester" <cklester at yahoo.com> Jan 23, 2003
- 393 views
On Wednesday 22 January 2003 11:08 pm, you wrote: > > The problem is, I have to retrieve the data from myList (the control) > > first and put it into a sequence... something like this: > > > > for t =3D 1 to getCount( myList ) do > > mySeq =3D append(mySeq, getItem( myList , t ) > > end for > > junk =3D gettok( mySeq, wildntok(mySeq,"IADC*",0,""),"") > > but your list is already in a sequence, remember: > myList =3D > {"IADCDAYW.DOT","OTHER.DOT","IADCFOOT.DOT","IADCTURN.DOT"} No, that was just indicating what myList would look like if in a sequence= =2E..=20 :) > Or matchtok, matchntok. The way you say myList is set up, you don't eve= n > run thru the parse/deparse routines in strtok. No, the sequence elements come from a winblows list control.