#18550 - 2002-03-12 11:52 PM
32k limitation?
|
Anonymous
Anonymous
Unregistered
|
Is there a 32k limitation on the actual script file? Part of the reason I wanted KIX implimented was to cut down on the total number of scripts we run. At 33.6k the first function in the script gives a script error - if I cut out 2k of script, the script runs, with no change to the meat and potatoes of the script itself.
Any help would be appreciated.
|
|
Top
|
|
|
|
#18552 - 2002-03-13 12:21 AM
Re: 32k limitation?
|
Anonymous
Anonymous
Unregistered
|
Maybe this will help - I know posting code is a faux paux, I'll keep it short.
code:
function UserOU() ;Used for generating several variables - This is required. $userou = "" $sysinfo = createobject("adsysteminfo") if $sysinfo $user = getobject("LDAP://"+$sysinfo.username) if $user $name=getobject($user.parent).name if $name $userou = substr($name,4,len($name)) endif endif endif endfunction
This is the function that craps out when the file is larger than 31k. It is used in the body of the script in several ID sections such as this.
code:
;----------Houston if INSTR($sysinfo.username, "Houston")<>0 $city="Houston" gosub "display" goto "houston" Endif
That help any? It's the only function I have.
|
|
Top
|
|
|
|
#18553 - 2002-03-13 01:39 AM
Re: 32k limitation?
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
how about having the users run a batch file that: copies the kix script to the local machine executes the local copy of the kix script deletes the local copy
It may take a few seconds longer to copy the file, but execution time may be faster.
|
|
Top
|
|
|
|
#18554 - 2002-03-13 03:19 AM
Re: 32k limitation?
|
Bryce
KiX Supporter
   
Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
|
Zzyzxx,
cool! another Houston kix user
what is the error? is the script stopping like a syntax error?
i am not seeing any check to make sure that $sysinfo is a valid COM object. Id $sysinfo was not a valid COM object and you tried making a call to a property, kix will error out.
i do not know if this is your problem or not, but i always do something like this.
code:
if vartype($sysinfo) <> 9 and @error <> 0 ? "error with $$sysinfo COM object @serror" exit(1) endif
right after getobject() command, this will prevent the script from crashing on a invalid COM object request.
Bryce
|
|
Top
|
|
|
|
#18555 - 2002-03-13 04:08 AM
Re: 32k limitation?
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
This is a long shot, but what happens if you declare your function vars local to the UDF itself, like this:
code:
function UserOU() dim $sysinfo dim $user dim $name
... the rest
Does that make any difference ?
-Shawn
|
|
Top
|
|
|
|
#18556 - 2002-03-13 04:37 PM
Re: 32k limitation?
|
Anonymous
Anonymous
Unregistered
|
I already have a batch file which does file checking/version checking.
Basically it checks to see if the file exists locally, if it does it executes kix32 locally. If it doesn't exist, it copies it locally and then runs it locally.
The error states that there's a missing comma in the code - -
if INSTR($sysinfo.username, "Houston")<>0 $city="Houston"
- - even though all you have to do is reduce the size of the file to get it to work. None of the script is actually being changed (other than removing remarks, unused script, etc).
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 657 anonymous users online.
|
|
|