Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP & VB command comparison?
Message
 
À
31/08/1998 23:39:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00131782
Message ID:
00133048
Vues:
15
Hi Peter...

For the most part, the langauges are very similar - at least where a feature set is in both langauges. Constructs like If..Endif, Case..EndCase are basically the same. There are a few minor differences. VB requires the Then keyword and you can have nested If..Endifs:

If x then y
else if z then
end if
End if

In small doses, this is nice. But, it can lead to unmangable code very quickly.

VFP on the whole, has a much richer language - particulary in the string manipulation and data manipulation arena. VFP is the hands down winner when it comes to working with arrays. In VFP, if you want to know the size of an array, you use the Alen() function. In VB, you use the Ubound() function. In this case, the names of the functions are very different. With regard to arrays again, VB supports nested arrays. For examle, an element in a VB array can actually be another array. VFP does not support this functionality. Its a bit of a pain because arguments that some COM Component methods accept require a nested array. The ADO CreateRecordSet Method is one example.

With regard to string, to make a string upper case in VFP, you use the Upper() function. In VB, it is the Ucase() function. Here, the names are a bit more similar.

What is very different in both environments are the variable scoping issues, strong data typing, etc. Also, VFP sports a containership and object model that is vastly superior to Visual Basic's.

So, when comparing the two environments, be sure to go beyond the langauge.



>Has anyone seen a command by command comparison for VFP and VB. I would love to see a sort of "French-English" dictionary where I could look up a command or function or operator in one language and be given the equivalent command/function/operator/expression in the other.
>
>My immediate need is a VBA expression that will return the word "Passed" or "Failed" depending on whether a boolean value is True (-1) or False (0).
>
>Don't worry--I'm not about to abandon VFP. What we will do for money!
>
>Peter Robinson
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform