Functions for Integrating Source Code
InsertFileText Function
InsertFileComment Function
InsertFunctionBody Function
InsertFunctionComment Function
InsertSymbolComment Function
InsertFileText Function
The InsertFileText function includes the content of the file assigned with the program source code in GD.
Declaration:
InsertFileText( string FilePath, string Format )
Parameters:
FilePath
- the DA-C path of a specified file
Format
- defines whether the fileExample:
#{ InsertFileText( "MathFun\Interpolations.c" , "FORMATTED" ) } #{ InsertFileText( "MathFun\Interpolations.c" , "UNFORMATTED ) }
InsertFileComment Function
The InsertFileComment function includes in GD the comment with which the file specified with the program source code begins.
Declaration:
InsertFileComment( string FilePath, string Format )
Parameters:
FilePath
- the DA-C path of a specified file
Format
- defines whether the comment is included as formatted or unformatted as in DA-C editor. Possible values of this argument are "FORMATTED" and "UNFORMATTED".Example:
#{ InsertFileComment( "MathFun\Interpolations.c" , "FORMATTED" ) }# #{ InsertFileComment( "MathFun\Interpolations.c" , "UNFORMATTED" ) }#
InsertFunctionBody Function
The InsertFunctionBody includes the definition of the function assigned in GD.
Declaration:
InsertFunctionBody( string FunctionName, string ModulePath, string Format )
Parameters:
FunctionName
- The name of the function included in GD,
ModulePath
- the path of the module in which the function assigned is defined. If the function assigned is global, ModulePath can be an empty string - "".
Format
- defines whether the function code is included unformatted or formatted as in the DA-C editor. Possible values of this argument are "FORMATTED" and "UNFORMATTED".Example:
#{ InsertFunctionBody( "Min_max" , "", "FORMATTED" ) }# #{ InsertFunctionBody( "Min_max" , "", "UNFORMATTED" ) }#
InsertFunctionComment Function
The InsertFunctionComment function includes in GD the comment which precedes the definition of the function specified.
Declaration:
InsertFunctionComment( string FunctionName, string ModulePath, string Format )
Parameters:
FunctionName - the name of the function whose comment is included in GD,
ModulePath - the path of the module in which the specified function is defined. If the specified function is global, the ModulePath could be an empty string - "".
Format - defines whether the code of the function is included as unformatted or formatted as in the DA-C editor. Possible values of this argument are
"FORMATTED" and "UNFORMATTED".Example:
#{ InsertFunctionComment( "Min_max" , "", "FORMATTED" ) }# #{ InsertFunctionComment( "Min_max" , "", "UNFORMATTED" ) }#
InsertSymbolComment Function
The InsertSymbolComment function is used to insert in GD the comment of an assigned global or module symbol.
First, the symbol comment is searched for in the location of the symbol definition, and if it is not found, then in the locations of all declarations of the symbol.
The comment in the location of the declaration or definition of a symbol is the content of all consecutive source lines with comments that precede the source lines of the declaration and definition. Between the comments and the very location of the definition, that is, declaration, there can be a random number of empty source lines. The comment in the location of a symbol declaration or definition can also be the content of a set of consecutive source lines with comments that begin in the line of the declaration, that is, definition, if the comment does not come before the location of the declaration or definition.
For example, in the following source code:
int var; // variable // comment // type comment typedef int type; // type /* This is multiline comment */
the comments of the var, type and main symbols are written in bold letters.
The inserted comment does not contain characters that mark the beginning and end of a comment (/*,*/,//), and also the characters defined by using the option Options/Flowchart Generator/Filter characters are filtered from the comment's content, while the comments defined by using the options Options/Flowchart Generator/Ignore prefix and Exception are completely ignored.
Declaration:
InsertSymbolComment( string SymbolName, string ModulePath, string Reserved )
Parameters:
SymbolName - the name of the symbol whose comment is included in GD,
ModulePath - the path of the module in which the specified symbol is defined. If the specified symbol is global, the ModulePath could be an empty string - "".
Reserved - string reserved for a future use, it must be empty - "".
Example:
#{ InsertSymbolComment( "Min_max" , "", "" ) }# #{ InsertSymbolComment( "Buffer" , "", "" ) }#
Copyright © 1993-2022, RistanCASE PR