Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
The Macro Language, Fundamentals of the Macro Language<br />
tion operator, then the logical “and” followed lastly by the logical “or”. The following are<br />
equivalent:<br />
A.LT.B.OR..NOT.C.GT.D.AND.E.EQ.F<br />
(A.LT.B).OR.((.NOT.(C.GT.D)).AND.(E.EQ.F))<br />
ad&&e==f<br />
(ad))&&(e==f))<br />
Function Calls<br />
The macro language provides a wide variety of functions to simplify the task of writing macros.<br />
Functions accept zero or more arguments as input and return a value of a specific type (e.g., real<br />
or logical), although there are a few functions that can return various result types. See<br />
“Simulation Macro Functions” on page 152 for a description of available VM specific macro<br />
functions, their input arguments and return values.<br />
The general syntax of a function call is as follows:<br />
$Ffunction_name( [argument [,argument...]] )<br />
The order in which the arguments are specified is very important. Some functions require no<br />
arguments, but the parentheses must still be specified. For example, the $FGETCWD() function<br />
(always called without parameters) returns the file path of the current working directory.<br />
A function can be used in an expression anywhere a value is permitted, if the function returns a<br />
data type consistent with the rest of the expression. Functions can be called as arguments to other<br />
functions.<br />
External Functions<br />
The macro processor supports the use of global user functions written in C ++ that have been<br />
compiled and linked into a shareable library (e.g., a .dll file on Windows or a .so file on UNIX).<br />
Sample source files, an API development kit and HTML documentation can all be found in the<br />
installation “Samples/SDK” folder.<br />
External functions must be defined before they can be used, so that the macro processor will<br />
know the name of the function and the number and data types of the parameters that are passed<br />
to the function. The declaration syntax is as follows:<br />
DECLAR / EXTERN,FUNCTION,'filename'[,type],name([type[,...])<br />
The filename string specifies the name of the shareable library. If the filename does not include<br />
the file type (e.g., .dll). then the default file type for the current Windows or UNIX architecture<br />
will be used. If the filename does not include a file path, or if the file path is relative, then the<br />
default path is the installation “bin/system-type” folder. On UNIX systems, the file name is case<br />
sensitive.<br />
The name defines the name of the function. External function names must always start with an<br />
alphabetic character. The remaining characters can be any combination of letters, digits and the<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 131