|
|
|||||||
(1) Trying to understand or get the include working: In our script today, we have: Code:
CALL works fine. Why can't I do the following? Code:
(2) Not sure of the search path of W/KIX32, but when I run: C:\Scripts>kix32 %logonserver%\netlogon\kldtest\kixtart The script works fine. But, when I run: C:\Scripts>kix32 %logonserver%\netlogon\kldtest\kixtart.KIX The script comes back with the following message: Quote: So, I am assuming that W/KIX32 automatically picks up on the .KX or compiled script before the .KIX or text version? How this came about is that I am playing with the script, but have one that is tokenized there. So, I get bad results unless I specify the .kix extension. Call me lazy. Thanks, Kent |
||||||||
|
|
|||||||
include is an include option. it includes the told script(s) to the including one, before any processing. if you wanna call - or in other words, include at run time - a script, use call. what comes to the .kix... well, worked for me on local drive... |
||||||||
|
|
|||||||
Right.. But what I want to do is to INCLUDE the function script that used by several different companies in our main login script and the problem is that I have to CALL function.kix file again from one of the branch-outs from KiXtart.kix. So, what you are saying is that you have to have a hard-mapped drive to run this correctly? Kent |
||||||||
|
|
|||||||
Did some more playing with this.. Commented out: Code:
And did some changes to my code - Yes I know Vars in Strings are evil. Code:
And.. Get an intersting error: Quote: |
||||||||
|
|
|||||||
IIRC, Ruud has stated multiple times that macros and variables cannot be used in the INCLUDE function, otherwise the pre-tokenization would not work if the final INCLUDE path is only being decided upon at run-time. Then again, doing an INCLUDE at run-time is kind-of pointless, anyway. |
||||||||
|
|
|||||||
and, if one wants it, there is call that does exactly that. |
||||||||
|
|
|||||||
The issue here is that the current implementation of INCLUDE only accepts clear-text scripts (ie: .KIX scripts, not .KX scripts). Sorry this wasn't clear yet, I'll make sure it is clarified in the documentation. Kind regards, Ruud |
||||||||
|
|
|||||||
Ruud, What about the macro and UNC in the path? Any comment? |
||||||||
|
|
|||||||
and the path... not relative to curdir but exe-dir. |
||||||||
|
|
|||||||
In short: INCLUDE takes either an absolute path (including a drive or UNC reference) or a path relative to the current directory. Using macros, vars or functions with an INCLUDE statement is not supported and does not make a lot of sense (at least not considering the way it was designed). All INCLUDE does is 'tack' the INCLUDed script into the INCLUDing script. The result is just as if you had typed the INCLUDed script in the INCLUDing script. After the INCLUDE is processed and the resulting script as been tokenized, the INCLUDE statement itself is effectively gone. What this does is provide a way to write small, modular, re-usable 'script-lets' and at the same time produce a single KX-script for use in production. If you need to be able to dynamically call different scripts based on runtime information, you really need the CALL statement. Let me know if there any additional questions or suggestions. Regards, Ruud |
||||||||
|
|
|||||||
yes. this is the info from start to finish. and even looks clean and mean enough for manual thanks ruud. |