Page 1 of 1 1
Topic Options
#176245 - 2007-05-14 03:13 PM ascan bug with mode = 1?
Christoph_Peus Offline
Fresh Scripter

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

please have a look at the following code and results (KiXtart 4.53):

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

results in -1 as expected, but

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

results in 3, which is the empty element of the array which does *not* contain "test"

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

results in 1, which is again the first empty element in the array.

Looks like a bug to me, or did I get something wrong here?
(The above expamles all yield -1 with mode = 0)

Regards
Christoph

Top
#176248 - 2007-05-14 03:40 PM Re: ascan bug with mode = 1? [Re: Christoph_Peus]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
Hi Christoph_Peus, and Welcome to the board

I am not sure what you are seeing, but with your examples I get:
-1
-1
-1
Results as expected, do you have other code around the AScan(), can you show us your full script that you are working with so that we can better help you.

_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#176249 - 2007-05-14 03:52 PM Re: ascan bug with mode = 1? [Re: Benny69]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Weird. I get the screwed up results on 4.53.

 Code:
$array = "a","b","c"
? AScan($array,"test",,,1)

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

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


 Quote:

-1
3
1


Edited by Mart (2007-05-14 03:53 PM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#176250 - 2007-05-14 03:56 PM Re: ascan bug with mode = 1? [Re: Benny69]
Christoph_Peus Offline
Fresh Scripter

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

thanks for your reply.

This is my full test script:
(added some information about my environment)

? @KiX
? @ProductSuite
? @ProductType
?
$array = "a","b","c"
? ascan($array,"test",,,1)
$array = "a","b","c",""
? ascan($array,"test",,,1)
$array = "a","","b","c"
? ascan($array,"test",,,1)

The output:

E:\admin>kix32 test

4.53
272
Windows Server 2003

-1
3
1
E:\admin>

Hmmm...

Top
#176253 - 2007-05-14 04:00 PM Re: ascan bug with mode = 1? [Re: Mart]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Can confirm the results with 4.53 on W2K Professional.
Can a mod move this to beta?
_________________________



Top
#176254 - 2007-05-14 04:03 PM Re: ascan bug with mode = 1? [Re: Jochen]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
I am using 4.51, wonder if there is a prob 4.53? can anyone else conferm a dif ver?
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#176255 - 2007-05-14 04:04 PM Re: ascan bug with mode = 1? [Re: Jochen]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Forgot to mention that I'm running WinXP pro SP2 fully updated so it looks like something is a little screwed up with ascan because it does not seem to be OS dependant.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#176256 - 2007-05-14 04:06 PM Re: ascan bug with mode = 1? [Re: Mart]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
I think Jochen is right, will need Jooel, Shawn or Doc to move this to Beta.
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#176257 - 2007-05-14 04:09 PM Re: ascan bug with mode = 1? [Re: Benny69]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
4.50 (does not support the extra flags):

 Code:
$array = "a","b","c"
? AScan($array,"test",,)

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

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

Sleep 10


 Quote:

-1
-1
-1


4.52:

 Code:
$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


 Quote:

-1
3
1
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#176258 - 2007-05-14 04:14 PM Re: ascan bug with mode = 1? [Re: Mart]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
thanks Mart looks like 4.52 has the same results as 4.53
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#176259 - 2007-05-14 04:19 PM Re: ascan bug with mode = 1? [Re: Benny69]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Yep. In 4.52 the extra flag were introduced so it looks like that’s when it stopped working as one would expect it to work.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#176260 - 2007-05-14 04:24 PM Re: ascan bug with mode = 1? [Re: Mart]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
If you specify an exact match (last arg=0 or omitted), it works. This appears to be a bug in the substring match logic.

This same set of results appears in 4.51 and higher releases, as the additional arguments of AScan were not supported in 4.50 and earlier. (tested on XP SP2 w/ versions 4.50 - 4.53)

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#176261 - 2007-05-14 04:40 PM Re: ascan bug with mode = 1? [Re: Glenn Barnas]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
Glenn, you get incorrect results on 4.51? I get the correct results in 4.51
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#176264 - 2007-05-14 08:52 PM Re: ascan bug with mode = 1? [Re: Benny69]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Running
 Code:
break on
@KIX ?
$array = "a","b","c"
AScan($array,"test",,,1) ?

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

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

yields
 Code:
BARNASGLAPTOP - C:\Temp>kix32 x.kix
4.53
-1
3
1

BARNASGLAPTOP - C:\Temp>kix324.52 x.kix
4.52
-1
3
1

BARNASGLAPTOP - C:\Temp>kix324.51 x.kix
4.51
-1
3
1

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#176272 - 2007-05-15 12:02 AM Re: ascan bug with mode = 1? [Re: Glenn Barnas]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Post does not need to be moved. Once it is confirmed as a "bug" then a single post to mention it and reference this post will suffice.
Top
#176275 - 2007-05-15 09:25 AM Re: ascan bug with mode = 1? [Re: Christoph_Peus]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
So Christoph,

it's up to you then ;\)
_________________________



Top
#176866 - 2007-06-10 10:20 PM Re: ascan bug with mode = 1? [Re: Benny69]
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
Page 1 of 1 1


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

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

Generated in 0.093 seconds in which 0.037 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