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

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
include('\\hirogen\libs\network.lib')

Cheers,
Peter Davidse

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

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:
Code:
CALL 'network.lib'
CALL '\\hirogen\libs\network.lib'



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

Registered: 2003-01-28
Posts: 4396
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).

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

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

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
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.

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

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.

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

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

Ruud

Top
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 514 anonymous users online.
Newest Members
Timothy, Jojo67, MaikSimon, kvn317, kixtarts2025
17874 Registered Users

Generated in 0.03 seconds in which 0.013 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org