SetOption('NoVarsInStrings','ON')
SetOption('Explicit','ON')
; Set user's default floor. This is set in an NDS group.
IF EXIST ("C:\WINNT\NOV\VAR3.W01") $DefaultLocation="W01" ENDIF
IF EXIST ("C:\WINNT\NOV\VAR3.W02") $DefaultLocation="W02" ENDIF
IF EXIST ("C:\WINNT\NOV\VAR3.W03") $DefaultLocation="W03" ENDIF
IF EXIST ("C:\WINNT\NOV\VAR3.W04") $DefaultLocation="W04" ENDIF
IF EXIST ("C:\WINNT\NOV\VAR3.W05") $DefaultLocation="W05" ENDIF
IF EXIST ("C:\WINNT\NOV\VAR3.W06") $DefaultLocation="W06" ENDIF
IF EXIST ("C:\WINNT\NOV\VAR3.W07") $DefaultLocation="W07" ENDIF
IF EXIST ("C:\WINNT\NOV\VAR3.W08") $DefaultLocation="W08" ENDIF
IF EXIST ("C:\WINNT\NOV\VAR3.L02") $DefaultLocation="L02" ENDIF
? "Check 1 for Defaultlocation " + $Defaultlocation
; Set users's current floor. This is done through checking of the IP subnet.
$ip3 = LTRIM(SUBSTR(@IPADDRESS0, 9, 3))
IF $ip3="121"
$Location="Lalaing building" + $Location
$Array="02_L HP4050 BW Computer Service", "02_L HP4500 Colour Computer Ser" ENDIF
IF $ip3="122"
$Location="Floor #2 + $Location
$Array="" ENDIF
IF $ip3="123"
$Location="Floor #3" + $Location
$Array="" ENDIF
IF $ip3="124"
$Location="Floor #4" + $Location
$Array="" ENDIF
IF $ip3="125"
$Location="Floor #5" + $Location
$Array="" ENDIF
IF $ip3="126"
$Location="Floor #6" + $Location
$Array="" ENDIF
IF $ip3="127"
$Location="Floor #7" + $Location
$Array="" ENDIF
IF $ip3="128"
$Location="Floor #8" + $Location
$Array="" ENDIF
? "Check 2 for Defaultlocation " +$DefaultLocation
? "LOCATION : " + $Location
For Each $Element In $Array
SHELL 'c:\winnt\system32\iprntcmd.exe "ipp://BR_CLUSTER_NDPS_VOL/ipp/$Element" /ADD'
Next
Only the first check (? "Check 1 for Defaultlocation ") gets printed on the screen the "Check 2" doesnt.
The "LOCATION" does not get printed, even though the $ip3 is correct
I know I can use the SELECT...CASE statement as well, but that does not work either.
bram
_________________________
bram