Page 1 of 1 1
Topic Options
#116405 - 2004-03-19 10:04 AM include librarys etc with UDF
ptrdvds Offline

Registered: 2004-03-19
Posts: 1
Loc: The Netherlands
It would be great if kix could use a library with UDF.
It makes scripting a lot more easy.
This way we could scripts ones use many eg distribute to other kix users.

include('network.lib') or

Peter Davidse

#116406 - 2004-03-19 10:16 AM Re: include librarys etc with UDF
Richard H. Administrator Offline

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
The facility is already available

Just use CALL to install the function library at the top of your script:
CALL 'network.lib'
CALL '\\hirogen\libs\network.lib'

#116407 - 2004-03-19 02:09 PM Re: include librarys etc with UDF
Glenn Barnas Administrator Offline
KiX Supporter

Registered: 2003-01-28
Posts: 4350
Loc: New Jersey
There's also an Include() UDF that locates the required library, searching in several folder locations. You should also look at the "Building large projects" on the KixForms BBS - This tool automatically identifies library functinos, scans your source for those functions, and includes them in a built script - ready for distribution. This allows breaking large projects into smaller, more managable components. Doc and I are working on a script that is nearly 9000 lines (so far).

Actually I am a Rocket Scientist! \:D

#116408 - 2004-03-19 02:29 PM Re: include librarys etc with UDF
Les Offline
KiX Master

Registered: 2001-06-11
Posts: 12734
IFAIK, Include is already being worked on (in regard to 4.5 and pretokenize) and should be discussed in the beta forum following the next (public) release.
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

#116409 - 2004-03-19 02:53 PM Re: include librarys etc with UDF
Richard H. Administrator Offline

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
CALL is suitable for loading libraries at run time.

The INCLUDE that has been proposed and may make it into a future release is not best suited to loading libraries for most applications.

The proposed INCLUDE is designed to in-line code when a script is tokenised, similar to linking static libraries into a single executable in languages like 'C'.

The benefit is that (when tokenised) the libraries are all included in the script file, so you have single tokenised script which you can distribute.

The bad news is that every script which has an INCLUDE is bloated by the copy of the libraries, and when you change the library you need to re-tokenise every script which uses it to get in new version included.

If you simply want a centralised store of common routines that you want to include in your scripts, CALL will do the job nicely and is already available.

#116410 - 2004-04-01 12:59 PM Re: include librarys etc with UDF
Ruud van Velsen Moderator Offline

Registered: 1999-05-06
Posts: 363
Loc: Amsterdam, The Netherlands
Just to let you know that the latest Alpha release includes an INCLUDE statement ;-)


Page 1 of 1 1

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

Who's Online
0 registered and 152 anonymous users online.
Newest Members
dimi575, Drecksnacken, Nlill, webtools321, multiman
17734 Registered Users

Generated in 0.032 seconds in which 0.011 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google: