Page 1 of 2 12>
Topic Options
#71674 - 2002-11-21 02:04 AM In reference to LIKE2 UDF
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Crazy Eddie
Since the UDF forum is for the actual UDF and not discussion I'm posting here to discuss it.

http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=12;t=000217

LIKE2("ron", "r?n")

returns a 0 for me. Am I using it incorrectly?

LIKE2("ron", "ron")
returns a 1 for me

Or do I need to set my parse character to the question mark?

Top
#71675 - 2002-11-21 08:20 PM Re: In reference to LIKE2 UDF
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Hmmm... Crazy Eddie elected not to allow us to PM him, and listed no other email address [Frown]

He also apparently has not seen this post either.

i.e. His UDF LIKE2
LIKE2 UDF

Does not appear to work for me, or I'm using it incorrectly.

[ 21. November 2002, 20:22: Message edited by: NTDOC ]

Top
#71676 - 2002-11-21 10:59 PM Re: In reference to LIKE2 UDF
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
NTDOC,

FYI, I think you need to use an '*' for a wildcard instead of a '?'.

More importantly I found some logical errors with this function anyway. The following function calls both returned 1 for me.

LIKE2("Edward is very cool, extra stuff, ", "Ed*w*rd *COOL")
LIKE2(", extra stuff, Edward is very cool", "Ed*w*rd *COOL")

Both calls should actually return 0. If the wildcard string does not begin and/or end with a wildcard, then the other string must begin and/or end with exactly the same as the wildcard.

For example, the following returns 1.

? LIKE2("executable.exe", "cu*.exe")

which could be devastating in the wrong situation.

-Eric
_________________________
Eric

Top
#71677 - 2002-11-22 12:57 AM Re: In reference to LIKE2 UDF
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Thanks maciep,

but his EXAMPLES in the code information show him using ? which is why I asked if I need to "specify" the paramater.

Anyways... yeah, either I'm doing it wrong, or it is not working correctly for me either.

Top
#71678 - 2002-11-22 05:41 PM Re: In reference to LIKE2 UDF
Crazy Eddie Offline
Starting to like KiXtart

Registered: 2002-11-20
Posts: 105
Loc: Sacramento, CA USA
NTDoc - I fixed my profile to allow PMs and email via the board. Thanks for the tip.

I also removed the 1.0 version in the reply to maciep. (It originally allowed ? and *...now * is hardcoded as the parse character.)

The new thread is the only current copy.

Maciep - you are correct, there's a logical error. Let me work on it, or I'll pull the posting. Sorry for the troubles.
_________________________
{Insert your favorite Witty Tag Line here}

Top
#71679 - 2002-11-23 01:08 AM Re: In reference to LIKE2 UDF
Crazy Eddie Offline
Starting to like KiXtart

Registered: 2002-11-20
Posts: 105
Loc: Sacramento, CA USA
Damn it took awhile, but I've posted the newest iteration of LIKE2()

It now Should work correctly. [Big Grin]

Note, it now treats "?" as exactly one wild character, and "*" as zero or more wild characters.

(I abandoned the array mask method completely.)

Please let me know if you find any bugs!

Crazy Eddie
_________________________
{Insert your favorite Witty Tag Line here}

Top
#71680 - 2002-11-25 03:16 PM Re: In reference to LIKE2 UDF
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
Found another one. The following returns 0:

LIKE2("ball", "*l")
LIKE2("success", "*s")

I ran into the same problem with words ending in two of the same letter while writing Like().

But that's the only problem I found with new LIKE2().

BTW Crazy Eddie, have you tested Like() since I added the search() function back to the post. If you don't find any internal errors anymore, I would appreciate it if you could take that part out of the LIKE2() posting. Thanks.

-Eric
_________________________
Eric

Top
#71681 - 2002-11-25 06:27 PM Re: In reference to LIKE2 UDF
Crazy Eddie Offline
Starting to like KiXtart

Registered: 2002-11-20
Posts: 105
Loc: Sacramento, CA USA
Eric,

I went to retest LIKE(), but it has been removed. I'm sorry.

I have updated my comments to accurately reflect that you deserve a lot of credit for the LIKE2() functionality. LIKE2() is superior, in that it allows CaseSensitive and fully supports * and ? searches. However, it wouldn't exist without your earlier example, and your assitance in testing.

Thank you.

I have corrected the final mask testing code for a repeating alpha string. (Ver 1.3)

I believe that is the last issue. Feel free to comment again!

Best to you,
Ed
_________________________
{Insert your favorite Witty Tag Line here}

Top
#71682 - 2002-11-25 09:47 PM Re: In reference to LIKE2 UDF
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
removed?
where it has been removed from?
http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=12;t=000217
_________________________
!

download KiXnet

Top
#71683 - 2002-11-25 11:24 PM Re: In reference to LIKE2 UDF
Crazy Eddie Offline
Starting to like KiXtart

Registered: 2002-11-20
Posts: 105
Loc: Sacramento, CA USA
Lonkero,

Clear your cache, and try again. I get "You have requested a topic that does not exist!" error, from multiple PCs.

(Unless UBB is personally targeting me.) [Mad]
_________________________
{Insert your favorite Witty Tag Line here}

Top
#71684 - 2002-11-25 11:26 PM Re: In reference to LIKE2 UDF
Crazy Eddie Offline
Starting to like KiXtart

Registered: 2002-11-20
Posts: 105
Loc: Sacramento, CA USA
It's been cleared from your Mirror site too. [Roll Eyes]
_________________________
{Insert your favorite Witty Tag Line here}

Top
#71685 - 2002-11-25 11:26 PM Re: In reference to LIKE2 UDF
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
right.
it was there yesterday.
check the udf-library (address in my sig)

it is still there.
_________________________
!

download KiXnet

Top
#71686 - 2002-11-25 11:27 PM Re: In reference to LIKE2 UDF
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
the mirror site updates currently once in 2 hours! eh, too fast I say but that is the reason why it's not there.
_________________________
!

download KiXnet

Top
#71687 - 2002-11-25 11:56 PM Re: In reference to LIKE2 UDF
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Lonkero..

Has nothing to do with how often the UDF is updated. I can not find the LIKE() UDF either. Search finds it, but when you click on it, it says You have requested a topic that does not exist! I assume the author removed it or a Moderator

p.s.
I have backed down my update time to 4 hours. For now since it does not really impact me, I let it update each 4 hours. If my system has issues or people in general don't want it updated that frequently - I guess I can back it down even further.

[ 25. November 2002, 23:57: Message edited by: NTDOC ]

Top
#71688 - 2002-11-25 11:58 PM Re: In reference to LIKE2 UDF
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
sorry doc, if you check it from my collection the udf is in there.

so, it is matter of update time,
if you don't have and I have, right?
_________________________
!

download KiXnet

Top
#71689 - 2002-11-26 01:56 PM Re: In reference to LIKE2 UDF
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
Hey everyone,

I am going to repost the Like() function anyway. It has been updated to also allow the single-character wildcard.

As far as LIKE2() is concerned I just tested it with the following

LIKE2("blinddd", "*dd")

And it returned 0. So there are still some logical errors.

Anyway, when I do post the Like() function again, please test the new functionality and let me know if you find anything that's not working.

-Eric
_________________________
Eric

Top
#71690 - 2002-11-26 09:29 PM Re: In reference to LIKE2 UDF
Crazy Eddie Offline
Starting to like KiXtart

Registered: 2002-11-20
Posts: 105
Loc: Sacramento, CA USA
Should I just pull LIKE2() ?

Can you add in case sensitivity?
_________________________
{Insert your favorite Witty Tag Line here}

Top
#71691 - 2002-11-26 09:35 PM Re: In reference to LIKE2 UDF
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
No, however, you might want to give a UDF a serious test drive before posting it.
_________________________
There are two types of vessels, submarines and targets.

Top
#71692 - 2002-11-26 09:40 PM Re: In reference to LIKE2 UDF
Crazy Eddie Offline
Starting to like KiXtart

Registered: 2002-11-20
Posts: 105
Loc: Sacramento, CA USA
I consider myself chastised. [Frown]
_________________________
{Insert your favorite Witty Tag Line here}

Top
#71693 - 2002-11-26 11:26 PM Re: In reference to LIKE2 UDF
Crazy Eddie Offline
Starting to like KiXtart

Registered: 2002-11-20
Posts: 105
Loc: Sacramento, CA USA
LIKE2() removed due to logical errors.

LIKE() functionality was improved, and LIKE2() is just another me-too UDF now.

It was a learning experience. [Smile]

-Ed
_________________________
{Insert your favorite Witty Tag Line here}

Top
Page 1 of 2 12>


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1782 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.081 seconds in which 0.031 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org