Article ID: 130456
Article Last Modified on 9/30/2003
- BASIC not case sensitive - C/C++ case sensitive - Pascal not case sensitive - Visual FoxPro not case sensitive
- BASIC Variables can be implicitly declared - C/C++ Variables must be explicitly declared - Pascal Variables must be explicitly declared - Visual FoxPro Variables are implicitly declared
- BASIC ' comment
- C/C++ // comment
/* comment block */
- Pascal { comment block }
- Visual FoxPro * full-line comment
- Visual FoxPro && partial-line comment
- BASIC nVal = 7
- C/C++ nVal = 7
- Pascal nVal := 7
- Visual FoxPro nVal = 7
STORE 7 TO nVal
NOTE: In Visual FoxPro, you can also assign values to fields in a table by
using the REPLACE command.
- BASIC If nCnt < nMax Then
nTot = nTot * nCnt
nCnt = nCnt + 1
End If
- C/C++ if(nCnt < nMax) {
nTot *= nCnt;
nCnt++;
}
- Pascal if nCnt < nMax then
begin
nTot:=nTot * nCnt;
nCnt:=nCnt + 1;
end
- Visual FoxPro IF nCnt < nMax
nTot = nTot * nCnt
nCnt = nCnt + 1
ENDIF
- BASIC Select Case n
Case 0
Print 'Zero'
Case Is > 0
Print 'Pos'
Case Else
Print 'Neg'
End Select
- C/C++ switch(n) {
case 0:
printf("Zero\n");
break;
case 1:
printf("One\n");
break;
default:
printf("?\n");}
- Pascal case n of
0: writeln("Zero");
1: writeln("One");
end
- Visual FoxPro DO CASE
CASE n = 0
? 'Zero'
CASE n > 0
? 'Pos'
OTHERWISE
? 'Neg'
ENDCASE
- BASIC For n = 1 to 10
Print n
Next n
- C/C++ for(n=1; n<11; n++)
printf("%d\n",n);
- Pascal for n := 1 to 10 do
writeln(n);
- Visual FoxPro FOR n = 1 TO 10
? n
ENDFOR | NEXT
- BASIC While n < 100
n = n + n
Wend
- C/C++ while(n < 100)
n += n;
- Pascal while n < 100 do
n := n + n;
- Visual FoxPro DO WHILE n < 100
n = n + n
ENDDO
- BASIC ABC ByVal X - C/C++ ABC(X); - Pascal procedure ABC (x:integer); - Visual FoxPro =ABC(X)
- BASIC ABC X
- C/C++ ABC(&VAR);
- Pascal procedure ABC
var x:integer);
- Visual FoxPro =ABC(@X)
DO ABC WITH X
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.
Keywords: KB130456