Page 1 of 1 1
Topic Options
#199721 - 2010-09-01 09:57 PM Display kix commands as they are called
blazer44 Offline
Just in Town

Registered: 2010-09-01
Posts: 2
Loc: Phoenix, AZ
Hello all,

I am trying to do something I think is probably simple but I am having trouble finding the answer. Is there a verbose mode for kix?

When I do basic copy and delete commands inside kix, can I have those commands write what they are doing to the command line? I am hoping I can do this without having to run the command and then print the command using ? for every line in the script.

I took over the management of a ton of scripts and am being tasked with parsing the script output for a new monitoring tool. I would love to do this without modifying all these old scripts or at least limiting the modifications needed.

I am running kix 3.62 and can not upgrade because it breaks the scripts. Also this is being run in a Windows Server 64 bit environment.

Thanks in advance,
Dan

Top
#199722 - 2010-09-02 12:45 AM Re: Display kix commands as they are called [Re: blazer44]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4567
Loc: USA
I don't know of a built in way to do what you want. You really need to think about redoing your script in a current version of kixtart. I had to go look in the 3.x manual just to see what was available because no one here uses it any more, and its like 10 years old now. There is so much more power and flexibility in 4.x.

I suggest you take your script in chunks, and convert it. If you get hung, post your code. This is a fairly responsive board.

Back to your request... to do this in Kix 4.x would be something like the following. You will need the readfile UDF (link below). One potential issue you could run into doing this is loops/ifs lines. About the only way to get around that would be to put the entire loop on one line...
 Code:
break on

for each $line in readfile(@scriptdir + "\yourscript.kix")
  ? $line
  $RC=execute($line)
next


Readfile() -
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=84660

The rest of the UDFs are here -
http://www.kixtart.org/forums/ubbthreads.php?ubb=postlist&Board=7&page=1

How to use UDFs -
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=81943#Post81943

Top
#199724 - 2010-09-02 08:33 AM Re: Display kix commands as they are called [Re: Allen]
blazer44 Offline
Just in Town

Registered: 2010-09-01
Posts: 2
Loc: Phoenix, AZ
Oh wow. 10 years old. Ok, I will start migrating them all the the latest version of kix. They do use a bunch of if...then...else and do...while commands so I am not sure if your idea would work. It is a really neat idea though.

Any other thoughts?

Actually, I will spend some time going through all the links you provided me tomorrow and report back. Thanks!!!


Edited by blazer44 (2010-09-02 08:34 AM)
Edit Reason: wasn't finished

Top
#199726 - 2010-09-02 09:28 AM Re: Display kix commands as they are called [Re: blazer44]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Apart from loops and conditionals Allen's script also breaks variable scope, function definitions (not that you're likely to have too many from 3.x), multi-line strings, long commands with line breaks for readability and other KiXtart intrinsics and constructs.

I'd recommend that you don't use Allen's script (sorry Allen) as if you're newish to KiXtart you'll end up spending a lot of time trying to fix perfectly working scrips that only fail because they are being executed in a strange way.

Occasional debug code is usually sufficient - I often leave it in place and control whether it displays or not with global variable.

You also have the option of running the script with the built-in debug tools if you want to step through the code, either using the "/d" command line switch or "DEBUG ON" in the code.

There are a few things that changed in the jump from 3.x to 4.x but they are well known and easily fixed, search the board for more information and post any script you are having difficulty with.

Top
#199732 - 2010-09-02 02:05 PM Re: Display kix commands as they are called [Re: Richard H.]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4567
Loc: USA
No worries... I knew it was far from a perfect solution.
Top
#199754 - 2010-09-03 02:05 PM Re: Display kix commands as they are called [Re: Allen]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Anyone remember the tool that MCA would run scripts through to debug? It would add a whole bunch of lines to output to the screen.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#199756 - 2010-09-03 02:22 PM Re: Display kix commands as they are called [Re: Les]
Mart Moderator Offline
KiX Supporter
*****

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

His site is still online. KixStrip is also there but it stops at version 4.22.
http://home.wanadoo.nl/scripting/
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#199758 - 2010-09-03 02:29 PM Re: Display kix commands as they are called [Re: Mart]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
 Originally Posted By: Mart
...it stops at version 4.22.
No prob then.

 Originally Posted By: blazer44
I am running kix 3.62 and can not upgrade...
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

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 320 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.077 seconds in which 0.051 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