Glenn Barnas
KiX Supporter
   
Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
|
FYI - I have a tool on my web site that makes working with UDFs very easy...
"KGen" is a "UDF Resolver" tool. It's available in the KixDev package, and it works like this:
You create a folder where you develop your scripts - lets say D:\Dev. In this location, you create a folder called KixLib and place all of your UDFs in that folder. Create a Bin folder and place Kix32.exe and the two KGEN scripts there. Add D:\Dev\Bin to your PATH so it can find the scripts. Create a System environment variable called "KixLibPath" and define it as "D:\Dev\Kixlib".
Create additional folders for each of your script projects in D:\dev. Assume this project is called MPUpdate (Multi-Profile Update), so create D:\Dev\MPUpdate.
So - now you have D:\Dev\KixLib, D:\Bin, and D:\MPUpdate. Go to the MPUpdate folder and create "mpupdate.txt", and place all your code for this project in that file. Do not place any UDFs in the file, although you can reference any of your UDFs freely!
When you are ready to try your code, simply open a command prompt, CD to D:\Dev\MPUpdate and type "KGEN MPUPDATE" - it will read your mpupdate.txt file, determine all needed UDFs (based on what exists in your library) and create a .KIX file with your code and all required UDFs. It will also perform a sanity check, looking for mismatched quotes, parens, and similar issues. It also identifies issues with variables, such as duplicate definitions, defined bun unused, and undeclared.
That's all it takes, although that's barely scratched the surface of the KGen capabilities. You can break large projects into smaller, managable chunks (I've got a project with over 12,000 lines of code in 15 files), and create a BUILD.INI file that tells KGen what to do in the project folder (name of project, tokenize the .KIX file, run Sanity or not, strip comments, copy the script to other locations, etc). With the build.ini file, you just type "KGen" and it knows what to do.
BTW - KGen is a recursive resolving engine. That means if you have a UDF in your library that depends on another UDF, KGen will place that UDF in your script, too.
Glenn
_________________________
Actually I am a Rocket Scientist!
|