Try something like this:
Code:
Dim $rc,$x
$rc=SetOption('explicit','on')
$rc=SetOption('novarsinstrings','on')

If Open(3, "deptmap.txt") = 0
$x = ReadLine(3)
While @ERROR = 0
$x = Split($x,",")
MapDrive($x[0],$x[3])
$x = ReadLine(3)
Loop
EndIf

Function MapGroupDrive($sUserGroup,$sRemoteShare)
"Mapping '"+$sRemoteShare+"' for '"+$sUserGroup+"'..."+@CRLF
; ... do mapping here ...
EndFunction