Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VB to VFP
Message
From
26/06/2003 16:21:11
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00804396
Message ID:
00804422
Views:
27
This message has been marked as the solution to the initial question of the thread.
hi Ali

I am not a VB programmer but it seems to me that the following code should work. however, you must find out the definition for 'moMapLayer' and the object 'Map1' must exist
#define moMapLayer          && fill in the value for the definition of 'moMapLayer' here
#define moFillSymbol  2
#define moLineSymbol  1
#define moPointSymbol 0

l     = .NULL.
ftype = ""

* *** create the object 'Map1' here

FOR EACH l IN Map1.Layers
   IF l.LayerType = moMapLayer
      DO CASE
         CASE l.Symbol.SymbolType = moFillSymbol
            ftype = "polygon"
         CASE l.Symbol.SymbolType = moLineSymbol
            ftype = "line"
         CASE l.Symbol.SymbolType = moPointSymbol
            ftype = "point"
      ENDCASE
      MessageBox(l.NAME + " contains " + ftype + " features")
   ENDIF
ENDFOR
hope this helps.

>Hi Everybody,
>
>I have a question for you. How do you translate the following VB codes into VFP 6:
>
>Dim l As Object
> Dim ftype As String
> For Each l In Map1.Layers
> If l.LayerType = moMapLayer Then
> Select Case l.Symbol.SymbolType
> Case moFillSymbol '2
> ftype = "polygon"
> Case moLineSymbol '1
> ftype = "line"
> Case moPointSymbol '0
> ftype = "point"
> End Select
> MsgBox l.Name & " contains " & ftype & " features"
> End If
> Next l
>
>I am specially intrested in "For Each I In Map1.Layers"
>
>Thank you,
>Ali
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform