Page 1 of 1 1
Topic Options
#47140 - 2003-10-22 12:37 AM Passing variables into a Kix self extract exe
AndyMack Offline
Fresh Scripter

Registered: 2003-06-04
Posts: 12
Loc: Wellington, New Zealand
After extensive searching of this forum and the user guide I turn to you all in desperation. I have used the most excellent editor KiXscripts Editor from iTripoli to turn one of my kix scripts into an self extracting exe (test.exe).

However, now I want to call test.exe from another program (filebuild, which is an IDEAS 4GL basic program running in a IBM UniVerse database) and pass test.exe a variable (a file name that filebuild creates and that test.exe will FTP to another server on our network). I know how to pass a .kix or .bat script a variable on the command line ($Var="whatever") but am at a loss with the exe.

The command in filebuild.exe for a .bat would be:
code:
Z3000.FILENAME = THEFILE
PERFORM "DOS /c C:\KIX421\KIX32.EXE C:\TEST.BAT $FILE=" : Z3000.FILENAME

and this works fine (The DOS /c is the IDEAS way of calling a DOS shell). However, change test.bat to at self extracting exe:

code:
Z3000.FILENAME = THEFILE
PERFORM "DOS /c C:\TEST.EXE $FILE=" : Z3000.FILENAME

and it all falls over. test.exe runs but with no variable being used.

Within test.exe, I Dim a variable ($Sourcefile) and then set it to $FILE ($SourceFile = $FILE). I then pass $SourceFile to various functions.

Any ideas please? TIA
_________________________
Andy Mack

Top
#47141 - 2003-10-22 12:57 AM Re: Passing variables into a Kix self extract exe
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Hi Andy,

Hopefully Steve from Kixscripts will catch this on a flyby, but in the meanwhile, have a lookie at this UDF:

GetOption() - Returns value of cmd-line option for scripts compiled...

-Shawn

Top
#47142 - 2003-10-22 02:08 AM Re: Passing variables into a Kix self extract exe
AndyMack Offline
Fresh Scripter

Registered: 2003-06-04
Posts: 12
Loc: Wellington, New Zealand
Thanks Shawn,

That function looks excellent. I will try it out immediately.

I will also update my search string ability because to miss this in my searches just sucks.
_________________________
Andy Mack

Top
#47143 - 2003-10-22 04:18 AM Re: Passing variables into a Kix self extract exe
sliver Offline
Getting the hang of it

Registered: 2002-09-05
Posts: 94
Use the $execmdline variable in your script and parse it to get the variable you need. The kix editor explains this better.

In the editor go to Help and choose .EXE packager help. Then choose Command Line Switches. This should explain the process but it's a little vague. I use this feature in a couple of scripts and it works well.

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
1 registered (Allen) and 33 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.052 seconds in which 0.024 seconds were spent on a total of 12 queries. Zlib compression enabled.

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