#201090 - 2010-12-07 04:19 AM
Re: Lost in quotes
[Re: KIXKicks]
|
Glenn Barnas
KiX Supporter
   
Registered: 2003-01-28
Posts: 4403
Loc: New Jersey
|
We have a couple of Kix apps that are 20,000+ lines that KGen makes quick work of.. I use KGen for even the smallest of scripts.
KGen is a form of link-editor that locates all external UDFs and resolves dependencies. We start by putting all of our common, generic UDFs into a KixLib folder out on a share. That folder is defined in a KIXLIBPATH environment variable. When we create a script, it's "scriptname.txt" and we can reference any UDF in the library.. KGEN SCRIPTNAME examines the library, indexes which files hold what UDFs, and when a UDF reference is found in the script source, that file is added to the generated script file. KGen also checks for dependencies within the UDFs, insuring that all needed UDFs are included, and included only once.
Our larger projects break the script source into smaller modules, maintained in a project folder. SAMPLE.TXT contains only a descriptive header and variable declarations, 01_FRM.KXF contains KixForms form definitions, 01_BASE.KXF contains the base code, and an assortment of files following the ##_DESC.KXF naming format contain individual, project-specific UDFs or code blocks. This allows a project to be broken into smaller, managable chunks. All .KXF and .UDF files in the project folder are included in the generated output, along with any UDFs from the central library. One large project contains about 40 sub-files with 100-200 lines per file - easier to digest and manage than the 17,000 lines would be in a single file.
Once KGen completes the assembly, it creates a .GEN file with all external UDFs, including comments. KGen then creates the .KIX file, possibly tokenizing the .GEN, or simply stripping comments (hence the reason for the .GEN clear source). KGen runs Sanity against the completed script, generates an index of variables, a report of warnings, and a code-map that shows the structure of paired functions. This alone can save hours of troubleshooting by helping to locate most issues before you even execute the script.
A config file can control the default operation of KGen. Simply running KGEN will locate the file and generate the script, while KGEN ARG1 would employ a differnt set of parameters to, for example, generate the script, tokenize it with Kix version 4.53, and copy it to a target folder.
KGen is free to download from our web site - it's part of the KixDev package. The library of UDFs is included, and the latest copy of all of our UDFs is PostPrepped and copied to our web server every night at 20:00 EST.
Glenn
_________________________
Actually I am a Rocket Scientist!
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 2630 anonymous users online.
|
|
|