#185239 - 2008-02-11 05:23 PM
Kixtart script checking
|
duo
Getting the hang of it
Registered: 2007-10-25
Posts: 61
Loc: iowa
|
Anyone know something that can test for warnings problems errors etc?
|
|
Top
|
|
|
|
#185244 - 2008-02-11 07:01 PM
Re: Kixtart script checking
[Re: Witto]
|
duo
Getting the hang of it
Registered: 2007-10-25
Posts: 61
Loc: iowa
|
|
|
Top
|
|
|
|
#185246 - 2008-02-11 07:12 PM
Re: Kixtart script checking
[Re: duo]
|
Glenn Barnas
KiX Supporter
   
Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
|
That's my Sanity UDF, as shown from KGen - another one of my tools that is used to sort-of link-edit your script with a library of function files.
KGen will scan your library, generate an association of what functions are in which files, and then scan your script file. It generates a resulting .KIX file with all necessary functions embedded, eliminating the need to manually include functions (and resolve their dependencies). As a final step, it generates several logs via Sanity(), including the output I showed you, and a reference of each variable, where it was declared, first referenced, etc. Excellent for debugging large or complex projects.
Sanity() is published here on on KORG, the latest revision is always on the resources page of my web site. The KixDev package on my site includes KGen, the entire dev library from the Resources page, and full documentation. You need to register your email to download, but the package is free. Email registration is kinda like collecting Ham radio call cards - I track who's using it, from where, and just demographic info, all of which helps me decide what products to focus on, and what improvements are warranted or suggested.
Glenn
_________________________
Actually I am a Rocket Scientist!
|
|
Top
|
|
|
|
#185250 - 2008-02-11 08:05 PM
Re: Kixtart script checking
[Re: Glenn Barnas]
|
duo
Getting the hang of it
Registered: 2007-10-25
Posts: 61
Loc: iowa
|
kgen seems like overkill/wrong for this and im not in the market to buy ASE. lets see what Sanity does for me
|
|
Top
|
|
|
|
#185253 - 2008-02-11 08:31 PM
Re: Kixtart script checking
[Re: duo]
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11628
Loc: CA
|
The Sanity UDF is an excellent script to locate potential errors in your script.
There is no tool that will be able to solve all your potential conflicts or missing code but Sanity will go a long way in clearing up common typos or general coding mistakes.
Using these SetOption values at the top of your script will also help / force you to write better code.
$SO=SetOption('Explicit','On')
$SO=SetOption('NoVarsInStrings','On')
$SO=SetOption('NoMacrosInStrings','On')
$SO=SetOption('WrapAtEOL','On')
|
|
Top
|
|
|
|
#185254 - 2008-02-11 09:05 PM
Re: Kixtart script checking
[Re: NTDOC]
|
duo
Getting the hang of it
Registered: 2007-10-25
Posts: 61
Loc: iowa
|
So what do you do when sanity gives you the clear and your error is random as heck?
|
|
Top
|
|
|
|
#185257 - 2008-02-11 09:25 PM
Re: Kixtart script checking
[Re: duo]
|
Witto
MM club member
   
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
|
|
Top
|
|
|
|
#185260 - 2008-02-11 10:05 PM
Re: Kixtart script checking
[Re: Mart]
|
duo
Getting the hang of it
Registered: 2007-10-25
Posts: 61
Loc: iowa
|
whats the difference between a blank line and a comment line?
ive never had any issues with the keyfinder line though im somewhat surprised about that
and what functions are sitting there not being used? every function is used multiple times, why else would i bother writing them?
|
|
Top
|
|
|
|
#185263 - 2008-02-11 10:40 PM
Re: Kixtart script checking
[Re: Mart]
|
duo
Getting the hang of it
Registered: 2007-10-25
Posts: 61
Loc: iowa
|
Agreed, right now the functions are separated from the actual script for good reason, i plan for it to be integrated in the future.
|
|
Top
|
|
|
|
#185264 - 2008-02-11 10:50 PM
Re: Kixtart script checking
[Re: Mart]
|
Glenn Barnas
KiX Supporter
   
Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
|
Initially, KGen might seem like overkill, but - did you know that with KGen's kix and bat files in your path or in the current folder, along with Kix32.exe, you can write your code in a .TXT file and simply say "KGen myfile"? It will scan and run Sanity on your script - just that easily - resulting in a .KIX file on the spot? No installation or configuration - just a simple way to get Sanity results.
Of course, it will tell you it found no library functions, and included none as well.. 
One of the coming features in KGen will be the ability to auto-generate the HTML/PostPrep file, and a report of commands that are supported by specific Kix versions - you'll be able to know if your script requires a specific mimimum version of Kix.
All you need to do to take the next step is put your function files on a server share somewhere and define KIXLIBPATH=\\server\share\folder, and KGen will automatically index and include any function from your library that you need. It generates the report files I showed you in the other thread, too. It can tokenize your script, but always leaves a plain-text .GEN file behind for you to recover from should you need it.
If you don't have a color-coding editor, you can check out the PostPrep script. A copy is available right from the first post in the Advanced Topics section. It will generate a colorized HTML file of your script, and you can even copy/paste the content into your posts (if you select HTML as your posting format option)
Glenn
_________________________
Actually I am a Rocket Scientist!
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1003 anonymous users online.
|
|
|