Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting a VB script to VFP
Message
From
04/08/2004 12:36:14
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00930631
Message ID:
00930689
Views:
13
Hi Sergey,

Just added:
            For Each objUser In objGroup.Members
                ? objUser.Name
            EndFor
So now it looks like:
colGroups = GetObject("WinNT://" + strComputer + "")
For Each objGroup In colGroups
	IF UPPER(objGroup.class) = "GROUP"
	    ? objGroup.Name, objGroup.class
            For Each objUser In objGroup.Members
                ? objUser.Name
            EndFor
	ENDIF
ENDFOR
Thanks, it worked fine!

Fernando


>Try
colGroups = GetObject("WinNT://" + strComputer + "")
>For Each objGroup In colGroups
>	IF UPPER(objGroup.class) = "GROUP"
>	    ? objGroup.Name, objGroup.class
>	ENDIF
>ENDFOR
>
>>
>>I have the following VB script, that I need to convert to VFP:
>>
>>
>>strComputer = "MyServer"
>>
>>Set colGroups = GetObject("WinNT://" & strComputer & "")
>>
>>colGroups.Filter = Array("group")
>>
>>For Each objGroup In colGroups
>>    Wscript.Echo objGroup.Name
>>    For Each objUser in objGroup.Members
>>        Wscript.Echo vbTab & objUser.Name
>>    Next
>>Next
>>
>>I tried to convert to the following VFP code, but get stuck with the line "colGroups.Filter = Array ("group")"
>>
>>strComputer = "MyServer"
>>
>>colGroups = GetObject("WinNT://" + strComputer + "")
>>
>>colGroups.Filter = Array ("group")
>>
>>For Each objGroup In colGroups
>>    Wait Window NoWait objGroup.Name
>>    For Each objUser In objGroup.Members
>>        Wait Window NoWait objUser.Name
>>    Next
>>Next
>>
>>Wait Clear
>>
>>How should it be?
>>
>>TIA,
>>
>>Fernando
Previous
Reply
Map
View

Click here to load this message in the networking platform