sizeof
The sizeof operator can be used to calculate the size in bytes of one of the basic types or a variable that has been declared. For example,
sizeof(double)
would return 8. The sizeof operator can also compute the size of simple structs or unions (see Structs and Unions). A simple struct is one that does not contain if statements or other statements that may change its size when declared. Attempting to compute the size of a non-simple struct or union will generate an error.
startof
The special keyword startof can be used on a variable that has been declared in a Template to calculate the starting address of the bytes the variable is mapped to in the file. For example, after opening a BMP file, use the following command in a script to position the cursor at the beginning of the first line of bitmap data:
SetCursorPos( startof( lines[0] ) );
exists
The special exists operator can be used to determine if a variable has been declared. The operator will return 1 if the given variable exists, or 0 if it does not. For example, after opening a ZIP file, the following command in a script will output all file names:
int i;
string s;
while( exists( file[i] ) )
{
s = file[i].frFileName;
Printf( "%s\n", s );
i++;
}
|