Page 2 of 2 <12
Topic Options
#102789 - 2003-07-11 08:26 PM Re: Kix Script Methodology
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
I think I've found two shortcomings in the code.

1) Calling a UDF from inside an EXECUTE statement like
code:
$iRC=EXECUTE('$a=CustomUDF($b)')

I do not see any code that analyzes the inside of an EXECUTE statement

2) Assigning UDFs to event triggers in KiXforms like
code:
$form.OnLostFocus='CustomUDF()'

_________________________
There are two types of vessels, submarines and targets.

Top
#102790 - 2003-07-11 09:19 PM Re: Kix Script Methodology
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
Inside an EXECUTE: (your example modified only to reference a UDF that exists on my system)

code:
 ;; KixGenerated: 2003/07/11 - 15:15:24 

$iRC=EXECUTE('$a=KixVer($b)')

;;
;;======================================================================
;;
;;FUNCTION KixVer(Minimum [, RETURN, BRC])
;;
;;ACTION Exits if not running minimum Kix or Beta version
;;
;;AUTHOR Glenn Barnas / FRIT-EROC
;;
;;SYNTAX KixVer(ver [,SoftErr [,BRC]])

Snipped for brevity. As you can see, the function is located and included. Based on the algorithm used, I feel confident that the result will be the same for the KixForms example.

I don't examine the code... that would take a tremendous amount of resources to analyze, not to mention the maintenance related to new versions of Kix. Instead, I look for UDFs on your system in the current dir, ..\kixlib dir, and the dir defined by your KixIncludePath environment var. Then I look at the base files to determine which DEFINED functions are required. Those function files are then reviewed to resolve dependencies, and so on until no further dependencies are found.

That is why there is a disclaimer in the code that says, in effect - this code won't resolve dependencies to UDFs that don't exist in the locations defined for inclusion. That's also why I'm confident that it will work for the KixForm example.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#102791 - 2003-07-11 09:28 PM Re: Kix Script Methodology
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Ah, I see. Interesting "reverse-parsing" of the actual script-code.

Maybe we should turn that into a new KiXgolf challenge.
_________________________
There are two types of vessels, submarines and targets.

Top
#102792 - 2003-07-11 09:50 PM Re: Kix Script Methodology
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
Well, one of the traditional programmer's traits is laziness. As it turns out, the easier way to parse it is also the most flexible moving forward.

You just can't reference a UDF and "generate" a script before you write (or download) that UDF with this tool. (not that it would work anyway!)

Hmm... there's an idea! How about extending the code to automatically scan and download UDFs from the Kix UDF forum??? [Eek!]

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#102793 - 2003-07-11 10:03 PM Re: Kix Script Methodology
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
OK - found a small bug after trying an unreferenced UDF. Updated the code above to avoid an error when only one but invalid UDF is referenced.

BTW - here's the result of a BadUDF being referenced:
code:
 
;; KixGenerated: 2003/07/11 - 16:04:12
$iRC=EXECUTE('$a=BadUDF($b)')

It simply copies the source file into the target, and doesn't add any UDFs at all. Obviously, UDFs that don't exist on your system won't be included in the generated file.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
Page 2 of 2 <12


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 314 anonymous users online.
Newest Members
Jojo67, MaikSimon, kvn317, kixtarts2025, SERoyalty
17873 Registered Users

Generated in 0.083 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