Page 1 of 1 1
Topic Options
#77952 - 2001-06-20 08:04 AM Including function from another File
Anonymous
Unregistered


I have this little problem:
I have done a lot of multipurpose functions, that are useful for a lot of scripts that i have done. The problem is that i would like to include this scripts in my scripts file like #include in C, because the CALL function is limitative for me, for example with a CALL i cannot Pass Paramters.
There is a way to do this??.

Example:

File A.Kix

Function Test(Parm1,Parm2)
...do Something
Test=Value
EndFunction

File B.Kix
#include A.Kix
MyValue=Test(Value1,Value2)
Quit
But the FUNCTION must stay in the same Kix file where i call it. What i need is a file where i have some FUNCTIONS (only Functions) and another file, the Main Script where, when i need, i call the functions that stay on the file where i stored my generic routines.
I want to do that, because i have a lot of routine that are the same in many scripts, and i would like to group these generic function in one kix file. I can use CALL Keyword: is good (so i can call an external file), but i cannot pass parameters, in this case i must use Global Variables. If is is possible to call a function that came from an external file is better.

Top
#77953 - 2001-06-20 08:58 AM Re: Including function from another File
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
Hi peschiergiorgio,

You can do this by just calling the first file in the second file. This is how most people make a library of functions.

Add the following line in B.kix (at the top of file):

call "A.Kix"

and all functions declared in 'A.kix' will be available to you in 'B.kix'

HTH

------------------
Greetz,

Roger the Young
------------------------
The code is out there...
------------------------

_________________________
The Code is out there

Top
#77954 - 2001-06-20 09:01 AM Re: Including function from another File
Anonymous
Unregistered


Thank You so much
Top
Page 1 of 1 1


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

Who's Online
0 registered and 2870 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

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