;================================================================
;= Function : ENumGroupIni
;= Author : Roberto Valentim
;= Example(s) : ENumGroupIni("C:\print.ini")
;================================================================
Function ENumGroupIni($file)
;================================================================
DIM $GrpArray, $Grupo, $GrpChave, $Chave, $Valores, $Valor
$GrpArray = split(readprofilestring($file, '', ''), chr(10))
For Each $Grupo in $GrpArray
If ($Grupo <> "")
If InGroup($Grupo)
; ? "Grupo >> " + $Grupo
$GrpChave = split(readprofilestring($file, $Grupo, ''), chr(10))
For Each $Chave in $GrpChave
If ($Chave = "Printers")
; ? " Chave >> " + $Chave
$Valores = split(readprofilestring($file, $Grupo, $Chave), ",")
For Each $Valor in $Valores
AddPrinterConnection("\\srv-jbgarq03\" + $Valor)
; ? " Printers >> " + $Valor
Next
EndIf
If ($Chave = "Default")
; ? " Chave >> " + $Chave
$Valores = split(readprofilestring($file, $Grupo, $Chave), ",")
For Each $Valor in $Valores
SetDefaultPrinter("\\srv-jbgarq03\" + $Valor) = 0
; ? " Default >> " + $Valor
Next
EndIf
Next
EndIf
EndIf
Next
EndFunction