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.