#143344 - 2005-07-11 05:30 PM
Re: Pre-Tokenized Scripts - Performance Impact?
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Quote:
Huh? Included files are as if the files were concatenated into one large file before tokenization so the result would be as if it were one large script. It is entirely possible for there to be var scope issues.
CALL and INCLUDE cannot be interchanged with impunity.
That's what I assumed when I first posted, but then I did some tests just to make sure that I wasn't talking bollocks.
Turns out I was talking bollocks.
Much to my surprise, INCLUDE does *not* just include the file as if it was in-line code when the main script is tokenized. Try INCLUDEing the same file twice with "Explicit" on - you will get a very revealing error message when you try to run the tokenized script
If you define (DIM) a local variable within an INCLUDED file you will see that it is not available to the script that INCLUDEd the subscript, so the scope is restricted tothe subscript as it would be in a CALL.
Strangely though, an EXIT in an INCLUDEd script still causes the main script to exit
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 661 anonymous users online.
|
|
|