Page 1 of 1 1
Topic Options
#127444 - 2004-10-05 07:15 PM passing a current command to a variable
Fugazi Offline
Starting to like KiXtart

Registered: 2001-04-23
Posts: 142
Loc: Pace, Fl.
Is there a way that I could pass the current command to a variable? I am trying to come up with a way to generate log files for each command that runs within a script and the sucess/fail of each command.

MD "c:\docs"
$err=@ERROR
$serr=@SERROR
Gosub errchk

:errchk
WriteLine (2,"$err,$serr"+@CRLF)
Return

I would like to also pass to the log file the line
MD "c:\docs"

I hope that I am making myself clear on this.
_________________________
I haven't failed. I just found another way that did not work.

Top
#127445 - 2004-10-05 07:42 PM Re: passing a current command to a variable
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
The only way I know to do something like that is to write your script and then repeat the command text min the output string with the result.


Code:

MD "c:\docs"
Writelog('MD "c:\docs" : Result - ' + @error + ' ' + @serror)



You can find the WriteLog function in the UDF library.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#127446 - 2004-10-05 08:18 PM Re: passing a current command to a variable
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
If you are up for the challenge, you could modify MCA's KiXstrip to include the commandline and not just the linenumber.

Or you could start from scratch and write the whole thing.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#127447 - 2004-10-19 01:18 AM Re: passing a current command to a variable
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

During the development process we see also the possible problems with GOSUB's. Problem that you can't see what was the previous executed line. So you can catch very fast the line with problems.
Simply by printing line-numbers you can trace which lines were executing exactly. Also we choice to keep the output as small as possible.
greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

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 1348 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.139 seconds in which 0.113 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