Difference between revisions of "CAEngine::CreateObject"
(Marked this version for translation) |
|||
Line 4: | Line 4: | ||
<translate> | <translate> | ||
− | = CreateObject(objName,objClass) = | + | = CreateObject(objName,objClass) = <!--T:1--> |
+ | <!--T:2--> | ||
Creates a new Analytica object with identifier «objName» and class «objClass» in the [[CurrentModule]] and returns it as a [[CAObject]]. | Creates a new Analytica object with identifier «objName» and class «objClass» in the [[CurrentModule]] and returns it as a [[CAObject]]. | ||
− | = Parameters = | + | = Parameters = <!--T:3--> |
+ | <!--T:4--> | ||
;objName: string - the new object's identifier | ;objName: string - the new object's identifier | ||
;objClass: string, one of: | ;objClass: string, one of: | ||
Line 34: | Line 36: | ||
* "Variable" | * "Variable" | ||
− | = Return value = | + | = Return value = <!--T:5--> |
+ | <!--T:6--> | ||
[[CAObject]] | [[CAObject]] | ||
− | = Example Usage = | + | = Example Usage = <!--T:7--> |
− | // C# | + | <!--T:8--> |
+ | // C# | ||
CAObject obj = ade.CreateObject ("NewVar","Chance"); | CAObject obj = ade.CreateObject ("NewVar","Chance"); | ||
− | = API errors = | + | = API errors = <!--T:9--> |
+ | <!--T:10--> | ||
* 40 – “Object could not be created” | * 40 – “Object could not be created” | ||
* 41 – “Invalid name for object” | * 41 – “Invalid name for object” |
Latest revision as of 18:18, 15 June 2015
ADE User Guide > ADE Server Class Reference > CAEngine
CreateObject(objName,objClass)
Creates a new Analytica object with identifier «objName» and class «objClass» in the CurrentModule and returns it as a CAObject.
Parameters
- objName
- string - the new object's identifier
- objClass
- string, one of:
- "Alias"
- "Attribute"
- "Button"
- "Chance"
- "Constant"
- "Decision"
- "Determ"
- "Form"
- "Formnode"
- "Function"
- "GraphStyleTemplate"
- "Index"
- "Library"
- "LinkLibrary"
- "LinkModule"
- "Model"
- "Module"
- "Objective"
- "Picture"
- "Text"
- "Variable"
Return value
Example Usage
// C# CAObject obj = ade.CreateObject ("NewVar","Chance");
API errors
- 40 – “Object could not be created”
- 41 – “Invalid name for object”
- 42 – “Object name already in use”
- 48 – “Invalid object class”
Comments
Enable comment auto-refresher