Page 1 of 1 1
Topic Options
#176277 - 2007-05-15 09:58 AM ascan bug with mode = 1
Christoph_Peus Offline
Fresh Scripter

Registered: 2007-05-14
Posts: 5
Hi,

if ascan() is used with mode = 1 and the scanned array contains empty elements, ascan always treats the empty elements like elements of matching value, i.e. returns the position of the first empty element instead of "-1" if the array doesn't contain a matching value.
Affected versions: 4.52, 4.53
This topic has been discussed here:
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=176245&page=1#Post176245

Regards
Christoph

Top
#176862 - 2007-06-10 09:12 PM Re: ascan bug with mode = 1 [Re: Christoph_Peus]
Ruud van Velsen Moderator Offline
Developer
*****

Registered: 1999-05-06
Posts: 391
Loc: Amsterdam, The Netherlands
Good call, I will have a look.

Ruud

Top
#176867 - 2007-06-10 10:20 PM Re: ascan bug with mode = 1 [Re: Ruud van Velsen]
Ruud van Velsen Moderator Offline
Developer
*****

Registered: 1999-05-06
Posts: 391
Loc: Amsterdam, The Netherlands
Hmm, I've been trying to repro this, but whatever I do, I can't get 4.53 to fail...

If anyone has more info on how to repro this bug, please let me know.

Ruud

Top
#176871 - 2007-06-10 10:42 PM Re: ascan bug with mode = 1 [Re: Ruud van Velsen]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Hmmmm. Weird

This code
 Code:
Break on

$array = "a","b","c"
? ASCAN($array,"test",,,1)

$array = "a","b","c",""
? ASCAN($array,"test",,,1)

$array = "a","","b","c"
? ASCAN($array,"test",,,1)

Sleep 10


Produces
 Quote:

-1 (correct)
3 (element 3 is empty)
1 (element 1 is empty)


on my system. Running WinXP Pro SP2 (UK) and Kix4.53.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#176872 - 2007-06-11 12:48 AM Re: ascan bug with mode = 1 [Re: Mart]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Same here except for the UK bit.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#176893 - 2007-06-11 06:19 PM Re: ascan bug with mode = 1 [Re: Les]
Ruud van Velsen Moderator Offline
Developer
*****

Registered: 1999-05-06
Posts: 391
Loc: Amsterdam, The Netherlands
Aha, turns out this is somehow OS dependent after all: I did all previous tests on Vista... Just now tried it on XP and repro'd first time.

Thanks for your persistence, I'll take it from here.

Ruud

Top
#177977 - 2007-07-16 03:10 PM Re: ascan bug with mode = 1 [Re: Ruud van Velsen]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Just an FYI to all.
The code above produces the correct results in version 4.60 beta1 of kixtart running on WinXP pro SP2 UK so it seems that this issue is fixed.


Edited by Mart (2007-07-16 03:11 PM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
Page 1 of 1 1


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

Who's Online
0 registered and 1429 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

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