Few months back, I was going through 4Test Language Reference (Silktest 5.01) PDF document. There I have seen the comparison of C Language and 4Test. Then I searched the same table in Silktest8.5 Help documentation. It is available under 4Test Reference -> About the 4Test Language -> Comparison of 4Test and C.
Comparison Table: 4Test and C language Keywords
Data type / Feature | C Language | 4Test Script |
Any type: Stores data of any type | No datatype available. | ANYTYPE aName |
Array | int ai[10]; |
|
Boolean: Stores either TRUE or FALSE | int b; | boolean b |
Character | char c; | string c. 4Test has no seperate data type for single character. |
Enumerated | enum COLOR{red, white, blue}; | type COLOR is enum red white blue |
Floating-point | float f; double d; |
|
Integer | int i; long, short, unsigned | integer i |
List | Similar datatype is not available. | list of integer li. 4Test has dynamic lists. |
Numeric | Similar datatype is not available. | number n.4Test NUMBER type stores either integers or floating point numbers. |
Pointer | char *p; | 4Test does not have pointers; however, data can be indirectly referenced using the @ operator. |
Pointer to function | int (*func) (); | @(sFunc) () |
String | char s[5]; | STRING s. 4Test strings are dynamically allocated; you do not need to declare their lengths. |
Structure | struct Person { char name[8]; int age; } | type Person is record { string name integer age} |
User-defined type | typedef struct Person PERSON_INFO; | type PERSON_INFO is Person |
Type cast operator | (typename) expression | [typename] expression |
Equality (==) operator differences | if ((i=5) == TRUE) --> This code compiles in C | if ((i=5) == TRUE) --> Ths code does not compile in 4Test:This difference is intentional. Because this construct can lead to unreadable code, 4Test does not allow it. |
No comments:
Post a Comment