The information in this article applies to:
SUMMARY
Most programming languages have similar features. If you are familiar
with one programming language, you can easily translate this knowledge to
another language. This article compares how BASIC, C/C++, Pascal and Visual
FoxPro implement the basic programming constructs in the following areas:
MORE INFORMATIONDealing with Case SensitivityOnly C/C++ is a case-sensitive programming language.
Declaring VariablesWhen you assign a value to a variable (other than an array) that does not exist, Visual FoxPro implicitly declares it. (Arrays must be declared using the DIMENSION command). Languages that require explicit declaration of variables return an error.
Adding CommentsEach language has its own format for adding comments to programs. Visual FoxPro has different formats for whole line comments and for comments on partial lines.
Storing Values to Variables (Assignment Statements)Pascal requires a colon in the assignment statement.
NOTE: In Visual FoxPro, you can also assign values to fields in a table by
using the REPLACE command.
Structuring IF StatementsEach language offers equivalent IF functionality.
Structuring CASE StatementsOnly Pascal does not offer ranges in CASE statements.
Structuring FOR LoopsEach language offers a FOR statement. C/C++ has the most flexibility for expressions.
Structuring WHILE LoopsEach language offers equivalent WHILE loop functionality.
Passing Parameters by ValueEach language permits passing parameters by value.
Passing Arguments by ReferenceYou can pass parameters by reference two ways in Visual FoxPro.
NOTE: By default, Visual FoxPro passes variables by value. However, you may
use the SET UDFPARMS command to specify whether FoxPro passes parameters by
value or by reference.
Syntax: SET UDFPARMS TO <VALUE> or <REFERENCE> For more information on the SET UDFPARMS command, please see the "SET UDFPARMS" topic in Visual FoxPro Help file. For more programming language comparisons, please see the "Visual FoxPro and Other Programming Lauguages" topic in the Visual FoxPro Help file. Additional query words:
Keywords : FxinteropGeneral |
Last Reviewed: August 25, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |