Elatec GmbH TWN3A1 用户手册

下载
页码 44
Elatec GmbH 
Page 23 of 44 
7.1.2  Comments 
In order to place a comment within the source code, two slashes are used. The remaining content of 
the line will be ignored by the compiler. 
 
7.1.3  Case Sensitivity 
The TWN3 script language is sensitive to upper and lower case. Examples: 
byte a;     // Valid 
Byte a;     // Invalid 
byte Byte;  // Valid(!) 
 
7.1.4  Preprocessor Directives 
The preprocessor is removing comments from the source code and processing the preprocessor 
directives. Currently, there is one directive available. 
 
7.1.4.1  #include Directive 
Include another source file and treat it as a part of the compiled source. There are two possibilities: 
#include <sys.twn.h> 
Include the given file, which is located relative to the directory, where TWNConfig.exe resides. 
#include “mydefs.twn.h” 
Include the given file, which is located relative to the current directory 
 
7.1.5  Functions 
Functions may be defined (“prototype”) in order to resolve forward references, or declared directly. 
The prototype of a function has the following form: 
(byte | void) identifier([list of arguments]); 
The declaration of a function has the following form: 
(byte | void) identifier([list of arguments]) 
   function body 
The function body is a block of statements. 
 
7.1.5.1  Return Values 
A function either has a return value (byte) or not (void). Following form is required to return a value: 
return expression