contents   index   previous   next



Converting existing C code to ScriptEase

 

Converting existing C code to ScriptEase is mostly a process of deleting unnecessary text. Type declarations, such as int, float, struct, char, and [], should be deleted. The following two columns give examples of how to make such changes. C code is on the left and can be replaced by the ScriptEase code on the right.

 

C ScriptEase

 

int i; var i; // or nothing

int foo = 3; var foo = 3;

struct var st; // no struct type 

{    // Simply use st.row

   int row;    // and st.col

   int col;    // when needed.

}

char name[] = "George"; var name = "George";

int goo(int a, char *s, int c); var goo(a, buf, c);

int zoo[] = {1, 2, 3}; var zoo = {1, 2, 3};

 

Another step in converting C to ScriptEase is to search for pointer and address operators, * and &. Since the * operator and & operator work together when the address of a variable is passed to a function, these operators are unnecessary in the C portion of ScriptEase. If code has * operators in it, they usually refer to the base value of a pointer address. A statement like "*foo = 4" can be replaced by "foo[0] = 4".

 

Finally, the > operator in C which is used with structures may be replaced by a period for values passed by address and then by reference.