Ets_Ma_Block_Write()
Note: Requires OPNET Development Kit
Abstract
Writes a list of name/value pairs to a block in a model assistant file.
Syntax
Ets_Ma_Block_Write (filename, block_name, name_value_lptr)
| Argument | Type | Description |
|---|---|---|
filename |
const char* |
Name of the model assistant file |
block_name |
const char* |
Name of the block in the assistant file |
name_value_lptr |
PrgT_List* |
Pointer to a list of name/value pairs; each pair should be of type PrgT_File_Parse_Name_Value_Pair*. |
options |
int |
Write options. Enter one of the following values: • ETSC_MA_FILE_WRITE_APPEND—If file exists, append the new block to the end of the file• ETSC_MA_FILE_WRITE_OVERWRITE—If file exists, overwrite original block contents in the file with the new block |
Return Type
EtsT_Compcode
Header
ets_api_ma.h
Details
This function copies the contents of the name/value list to a block within an assistant file.
- If
<filename>already exists, this function overwrites the original block contents or appends the new block to the end of the file (depending on the<options>argument). - If
<filename>does not exist, this function creates a new model assistant file; this file contains the specified block and a header block that specifies the version number of the model assistant. (If<filename>does not include an ".ma" extension, this function appends it automatically.)
The resulting block appears in this format:
start_<block_name>
<name_string_1>: <value_string_1>
<name_string_2>: <value_string_2>
...
end_<block_name>