Quote:

a problem where SELECT CASE allows only one CASE statement to be executed



This is not a problem but by design! Teh SELECT-CASE-ENDSELECT construct processes only the first CASE statement that evaluates to TRUE. This is explained in the KiXtart Manual.

One can also provide the mapping information in an external .INI file instead of using a long list of IF conditions
Example code:
Code:

;-------------------------------------
; function to map drives based on user groups
;
; Structure of the .INI file:
;[UNC]
;Drive = drive letter to which the UNC name will be mapped
;Label = optional lable for Windows 2000/XP/2003
;GroupInclude = User groups to be included in the drive share
;CompExclude = Computers to be excluded from the drive share
;UserInclude = Users to be included in the drive share
;NetworkType = Type of network connection allowed for this share (LOCAL, LAN, VPN, DIALUP)
;Persistent = True if mapping is persistent
;DenyGuestAccess = True if guests are not allowed to access this share
;-------------------------------------
function NETWORKED_DRIVES
Dim $uncs, $drive, $unc, $persistent, $rc, $server
Dim $GroupInclude, $CompExclude, $UserInclude, $denyguestaccess
Dim $networktype, $label

if not exist($SHARESINI)
$rc=warning('NETWORKED_DRIVES: Cannot open network shares initialization file '+$SHARESINI)
exit 0
endif

$rc=displaytext('Connecting network shares')

$uncs=readprofilestring($SHARESINI,'','')
$uncs=atrim(split($uncs,chr(10)))
for each $unc in $uncs
if $unc
$drive=trim(readprofilestring($SHARESINI,$unc,'Drive'))
if $drive
$denyguestaccess=val(readprofilestring($SHARESINI,$unc,'DenyGuestAccess'))
if $GUESTACCESS=1 and $denyguestaccess=1
$rc=displaytext('Guest access is not allowed to UNC '+$unc)
use $drive+':' /delete /persistent
else
$networktype=readprofilestring($SHARESINI,$unc,'NetworkType')
$networktype=atrim(split($networktype,','))
if ascan($networktype,$NETWORKCONNECTION)+1
$GroupInclude=readprofilestring($SHARESINI,$unc,'GroupInclude')
$GroupInclude=atrim(split($GroupInclude,','))
$CompExclude=readprofilestring($SHARESINI,$unc,'CompExclude')
$CompExclude=atrim(split($CompExclude,','))
$UserInclude=readprofilestring($SHARESINI,$unc,'UserInclude')
$UserInclude=atrim(split($UserInclude,','))
$persistent=val(trim(readprofilestring($SHARESINI,$unc,'Persistent')))
$label=trim(readprofilestring($SHARESINI,$unc,'Label'))
; translate macros in UNC
if instr($unc,'@@')
$rc=execute('$unc="'+$unc+'"')
endif
; translate macros in label
if instr($label,'@@')
$rc=execute('$label="'+$label+'"')
endif
if isincluded($GroupInclude, $CompExclude, $UserInclude)
$rc=mapdrive($drive,$unc,$persistent,$label)
if @ERROR
$rc=err('Unable to map to share '+$unc+' due to the following error : '+@SERROR,,$ALERTSERVER)
else
$rc=displaytext('Mapping drive '+$drive+' to share '+$unc)
endif
else
$rc=warning('Not authorized to map drive letter '+$drive+' to '+$unc)
use $drive+':' /delete /persistent
endif
else
$rc=warning('Network connection type '+$NETWORKCONNECTION+' not authorized to map drive letter '+$drive+' to '+$unc)
use $drive+':' /delete /persistent
endif
endif
endif
endif
next
endfunction

_________________________
There are two types of vessels, submarines and targets.