Quote:

Also, another question if I may!?
The first three letters of the Security Group identify the Building and the Floor...Building Poultry (P), Floor 4 (F4)..PF4 then the zone number..Z3 so PF4Z3, I have seen the use of CASE Select before, but I have not been able to come up with something that would make the script to jump straight to the relevant floor and zone !? Is it posible???




Yes.

You should zero fill numbers so that they are the max width you would expect, so your groups would be PF04Z03 - this makes it soooo much easier to script.

Here is an example of a way to extract the information:
Code:
Break ON

$iIndex=0
$sGroup=EnumGroup($iIndex)
While $sGroup AND Not @ERROR
; Drop domain
If InStr($sGroup,"\") $sGroup=SubStr($sGroup,InStr($sGroup,"\")+1) EndIf
; If Second letter is a "F" and fourth letter is a "Z" then it is a location
If SubStr($sGroup,2,1)="F" AND SubStr($sGroup,4,1)="Z"
$sBuilding=SubStr($sGroup,1,1)
$sFloor=SubStr($sGroup,3,1)
$sZone=SubStr($sGroup,5,1)
EndIf
$iIndex=$iIndex+1
$sGroup=EnumGroup($iIndex)
Loop

If $sBuilding
"This user is located: " ?
" Building: "+$sBuilding ?
" Floor: "+$sFloor ?
" Zone: "+$sZone ?
Else
"NO LOCATION INFO FOR THIS USER!" ?
EndIf



[edit] Fixed incorrect substring for "$sFloor" [/edit]


Edited by Richard H. (2005-01-25 12:59 PM)