Page 1 of 1 1
Topic Options
#209550 - 2014-10-21 09:46 AM Bug or not bug
ChristopheM Offline
Hey THIS is FUN
*****

Registered: 2002-05-13
Posts: 311
Loc: STRASBOURG, France
Here is a very sample code :
 Code:
$arrParams = GetCommandLine(1)

"version KIX         : " @KIX ?
"command line string : " GetCommandLine(0) ?
"command line array  : " ?
for each $param in $arrParams
	"  " $param ?
next

"user                : " $user ?
In some case, i don't get the wanted result !!!

with the following command line
 Code:
kix32 test.kix $user="_00001"
The result is OK
 Code:
version KIX         : 4.64
command line string : kix32 test.kix $user="_00001"
command line array  :
  kix32
  test.kix
  $user=_00001
user                : _00001


with the following command line
 Code:
kix32 test.kix $user="00001"
The result is wrong
 Code:
version KIX         : 4.64
command line string : kix32 test.kix $user="00001"
command line array  :
  kix32
  test.kix
  $user=00001
user                : 1

it seems that when splitting the commandline, KiXtart deletes double-quote and tries to convert strings to integer !!!

i have tested this code with all versions from 4.53 to 4.64 and have the same behavior.
Is it a bug or is it by design ?

this is a little bit annoying because for an application, i have to launch a script on hundreds of subdirectories called in numerical format. I can by-pass the problem by adding a special character in the commandline and removing it in the script like following :
 Code:
commandline : kix32 test.kix $user="_00001"
 
script :
$user = substr($user,2)
$arrParams = GetCommandLine(1)

"version KIX         : " @KIX ?
"command line string : " GetCommandLine(0) ?
"command line array  : " ?
for each $param in $arrParams
	"  " $param ?
next

"user                : " $user ?
 
result :
version KIX         : 4.64
command line string : kix32 test.kix $user="_00001"
command line array  :
  kix32
  test.kix
  $user=_00001
user                : 00001
but this is not very nice

Christophe
_________________________
Christophe

Top
#209561 - 2014-10-22 02:12 AM Re: Bug or not bug [Re: ChristopheM]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I think it is by design. I don't like it but like you stated, it has been like that forever.
_________________________
!

download KiXnet

Top
#209562 - 2014-10-22 03:33 AM Re: Bug or not bug [Re: Lonkero]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
See Ruud's response to a similar topic...

http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=180025#Post180025

Top
Page 1 of 1 1


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

Who's Online
0 registered and 874 anonymous users online.
Newest Members
StuTheCoder, M_Moore, BeeEm, min_seow, Audio
17884 Registered Users

Generated in 0.054 seconds in which 0.026 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