Les
(KiX Master)
2004-01-01 04:40 PM
File Summary for tokenized scripts

When working on multiple variations of a script, one can always keep track of the variations by reviewing the code. Unfortunately, with the tokenized version that is no longer possible. Relying a naming scheme or time stamps just won't do.

It would be nice if we could have a few comment fields that would be populated in the script which would then appear as clear text in a header of the tokenized code. Possibly those same fields could also be viewed in the file Properties | Summary dialog. The fields available there are:
Title:
Subject:
Author:
Category:
Keywords:
Comments:
Source:
Revision Number:


Richard H.Administrator
(KiX Supporter)
2004-01-05 02:07 PM
Re: File Summary for tokenized scripts

Having a plain text preamble is not a bad idea, but in the mean time why not just include a version print routine at the very start of your script?

Code:
If IsDeclared($ShowVersion)
"File: vinfo.kix"
"Desc: Version Info Example"
"Version: 1.0.0" ?
"Created: 5th January 2004" ?
"Creator: Richard Howarth" ?
Exit 0
EndIf



The version information will be printed when you call the script with:
Code:
kix32.exe myscript.kx $ShowVersion



Things could get a bit messy with the proposed "INCLUDE" to inline subscripts - how would you see those being represented? Collate all the info/preamble at the top of the script? Have a KiXtart switch to print the preamble/info fields?


Radimus
(KiX Supporter)
2004-01-05 02:18 PM
Re: File Summary for tokenized scripts

because, you would want to know what the script is/does... you could rename the script and you wouldn't know what it does. if the tokenized script is also CRC'd you couldn't change the preamble without killing the code

Richard H.Administrator
(KiX Supporter)
2004-01-05 03:38 PM
Re: File Summary for tokenized scripts

Quote:

because, you would want to know what the script is/does... you could rename the script and you wouldn't know what it does. if the tokenized script is also CRC'd you couldn't change the preamble without killing the code



I don't understand your point - perhaps you misunderstood my post, which was suggesting an interim solution.

Could you elaborate?


Radimus
(KiX Supporter)
2004-01-05 04:06 PM
Re: File Summary for tokenized scripts

well, with your example, you would have to run the code to determine what it was.

My point is that a simple text header would let someone determine what the code was, if someone were to manually edit the header info, the CRC would change and then kill the code... you would have to re-tokenize from the source ... simple measure of security... prevent the code from being tampered with, or replaced with an unexpected code.


Richard H.Administrator
(KiX Supporter)
2004-01-05 05:00 PM
Re: File Summary for tokenized scripts

I thought that's what you might have meant - I was actually supporting the idea of a preamble but also providing an interim solution until it becomes available.

If the version info is in the code then it is also protected by the CRC of course, although running untrustworthy code is always going to be a gamble.

I'm not sure how stopping someone changing the comment/preamble section provides much security. I assume that you think that (some of) the fields should be auto-generated rather than manually entered? That would help a little although much of the information could be spoofed and CRCs are pretty simple to manipulate if you are planning somthing underhand.

If you are really concerned about the integrity of the files you would probably be better off maintaining independant MD5 hashes.