contents   index   previous   next



ScriptEase versus C language

 

This section is primarily for those who already know how to program in C, though novice programmers can learn more about the Clib and SElib objects and C concepts by reading it. The emphasis is on those elements of ScriptEase that differ from standard C. Most of the pertinent differences involve the Clib object, SElib object, and CString object. Users who are not familiar with C should first read the section on ScriptEase JavaScript.

 

The assumption here is that readers of this section already know C. Thus, only those aspects of the C portion of ScriptEase that differ from C are described. If something is not mentioned here, ScriptEase follows standard C behavior. While in this section on the differences from C, the term ScriptEase is used for the portion of ScriptEase that implements the standard C library and ScriptEase additions to that library. Almost all of the implementation of C in ScriptEase involves the use of Clib objects, SElib objects, or CString. Thus, references to ScriptEase as the C portion of ScriptEase usually involve Clib, SElib, or CString.

 

Deviations from C result from following several principles:

 

simplicity

power

safety

 

The C portion of ScriptEase is different from C where changes make ScriptEase more convenient for scripting, writing small programs, and entering command line code or where unaltered C rules encourage coding that is potentially unsafe. Keep in mind, that most issues involved in this section involve the use of Clib, SElib, and CString.

 

The C portion of ScriptEase is C without type declarations and pointers. If you already know C and can forget these two aspects of C while using ScriptEase, then you already know the C portion of ScriptEase. If you were to take C code and delete all the lines, code words, and symbols that either declare data types or explicitly point to data, then you would be left with code that would work with Clib, SElib, and CString. Though you would be altering source code, you would not be removing capabilities.

 

The most basic idea underlying this section is that the C portion of ScriptEase is C without type declarations and pointers.

 


Data types in C and SE

Automatic type declaration

Array representation

Automatic array allocation

Automatic and JavaScript Arrays

Literal strings

Structures

Passing variables by reference

Pointer operator * and address operator &

Case statements

Initialization code which is external to functions

Unnecessary tokens

Macros

Token replacement macros

Back quote strings

Converting existing C code to ScriptEase