Difference between revisions of "CAEngine::OpenModel"
(Created page with '<< class CAEngine = OpenModel(fileSpec) = Reads a model from a disk file and opens it as the current model. The «fileSpec» is interpreted relative to the [[Curr…') |
|||
Line 1: | Line 1: | ||
− | [[CAEngine | + | [[Category:ADE User Guide]] |
+ | [[ADE User Guide]] > [[ADE Server Class Reference]] > [[CAEngine]] | ||
+ | <languages /> | ||
+ | <translate> | ||
= OpenModel(fileSpec) = | = OpenModel(fileSpec) = | ||
Line 29: | Line 32: | ||
* 4 – Statement error (load was only partially successful) | * 4 – Statement error (load was only partially successful) | ||
* 39 – “Model could not be found” | * 39 – “Model could not be found” | ||
+ | </translate> |
Revision as of 18:51, 15 June 2015
ADE User Guide > ADE Server Class Reference > CAEngine
OpenModel(fileSpec)
Reads a model from a disk file and opens it as the current model. The «fileSpec» is interpreted relative to the CurrentModelDirectory.
Parameters
- FileSpec
- string (the filename containing the model)
Return value
ModelName – string (actual model name)
Example Usage
string modName = ade.OpenModel("C:\TMP\MYMODEL.ANA");
Remarks
Failure should be detected by checking whether the return value is "", not by checking for a zero ErrorCode. It is possible that some errors or warnings might occur during loading, and is thus reflected in the ErrorCode, ErrorText, and OutputBuffer properties, even though the load was successful.
API errors
- 2 – Warning (but load was successfully completed)
- 3 – Lexical error (load was only partially successful)
- 4 – Statement error (load was only partially successful)
- 39 – “Model could not be found”
Comments
Enable comment auto-refresher