Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VB6 substitute for the V/FP & (macro substitution)
Message
 
À
02/05/1999 19:26:20
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00214445
Message ID:
00214448
Vues:
28
>In FoxPro, I can call a function with macro substitution. I have to use a very long Select Case statement in VB6 to accomplish the same thing. Is there a more efficient way to do this in VB6? (See examples below):
>
>Thanks,
>
>Dan
>
>FoxPro Code:
>SCAN
> lcMethodName = "ST+states.stcode+"()"
> DO &lcMethodName && Load the map polygon
> =DrawPolygon(@laMap)
>ENDSCAN
>
>Visual Basic 6 Code:
>For iCntr = 1 To UBound(pvarMap,1)
> Select Case pvarMap(iCntr,mapMethodName)
> Case "1100"
> pvarMap = USMap.St1100(dxAxis,dyAxis)
> Case "1110"
> pvarMap = USMap.St1110(dxAxis,dyAxis)
> Case "1120"
> pvarMap = USMap.St1120(dxAxis,dyAxis)
>
> End Select
> DrawPolygon(ByRef pvarMap As Variant)
>Next

Check for the CallByName function. Be advise that flexibility that it offers is at the cost of performance!
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform