Usage of PROCEDURE
Usage of PROCEDURE
RE: Usage of PROCEDURE
Mateusz Dziedzic
https://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=1072960
2017-12-07T13:04:25Z
2017-12-07T12:59:51Z
The error is because of the brackets for the result parameter in the call of the GET_POOL_NAME procedure. The call should look like the following: <div class="code"><span class="code-lines">1</span>GET_POOL_NAME modelid: (my_modelid) instid: (my_instid) result: pool_name</div>
Mateusz Dziedzic
2017-12-07T12:59:51Z
Usage of PROCEDURE
Swante
https://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=465629
2016-02-24T17:44:19Z
2016-02-24T17:44:19Z
Hello,<br /><br />I've got problems with the call of PROCEDUREs. I don't see any usage of the reference prameter in the documentation.<br /><br />What I understand:<br /><em>Attribute parameters </em>with <em>value parameters </em>is a normal read-only IN-Paramter (Call by value)<br /><em>Attribute parameters </em>with <em>reference parameters </em>is read-write IN-OUT-Paramter (Call by reference)<br /><br />I try to define a global PROCEDURE which should be called in some EVENTs.<br /><div class="code"><span class="code-lines"> 1</span>#===============================================<br /><span class="code-lines"> 2</span>#---- INIT GLOBAL VARS<br /><span class="code-lines"> 3</span>ON_EVENT "AppInitialized"<br /><span class="code-lines"> 4</span>{<br /><span class="code-lines"> 5</span> PROCEDURE global GET_POOL_NAME modelid: integer instid: integer result: reference<br /><span class="code-lines"> 6</span> {<br /><span class="code-lines"> 7</span> #get the class_id of the object<br /><span class="code-lines"> 8</span> CC "Core" GET_CLASS_ID objid:instid<br /><span class="code-lines"> 9</span> SET class_id: (classid)<br /><span class="code-lines">10</span> <br /><span class="code-lines">11</span> #get pool class_id<br /><span class="code-lines">12</span> CC "Core" GET_CLASS_ID classname:("Pool")<br /><span class="code-lines">13</span> SET pool_class_id:(classid)<br /><span class="code-lines">14</span> <br /><span class="code-lines">15</span> #only NOT pools should go on<br /><span class="code-lines">16</span> IF (class_id <> pool_class_id) {<br /><span class="code-lines">17</span> CC "Core" GET_ATTR_VAL objid: (instid) attrname: ("Position")<br /><span class="code-lines">18</span> SET my_position: (val)<br /><span class="code-lines">19</span> SET result:("Drin")<br /><span class="code-lines">20</span> }<br /><span class="code-lines">21</span> ELSE {<br /><span class="code-lines">22</span> SET result:("Draußen")<br /><span class="code-lines">23</span> }<br /><span class="code-lines">24</span><br /><span class="code-lines">25</span> }<br /><span class="code-lines">26</span>}<br /><span class="code-lines">27</span><br /><span class="code-lines">28</span><br /><span class="code-lines">29</span>ON_EVENT "CreateInstance"<br /><span class="code-lines">30</span>{<br /><span class="code-lines">31</span> SET my_classid: (classid)<br /><span class="code-lines">32</span> SET my_instid: (instid)<br /><span class="code-lines">33</span> SET my_modelid: (modelid)<br /><span class="code-lines">34</span> SET pool_name: ("")<br /><span class="code-lines">35</span> <br /><span class="code-lines">36</span> GET_POOL_NAME modelid:(my_modelid) instid:(my_instid) result:(pool_name)<br /><span class="code-lines">37</span><br /><span class="code-lines">38</span> CC "Core" GET_ATTR_ID classid: (my_classid) attrname: ("Pool name")<br /><span class="code-lines">39</span> SET pool_name_attrid: (attrid)<br /><span class="code-lines">40</span> CC "Core" SET_ATTR_VAL objid: (my_instid) attrid: (pool_name_attrid) val: (pool_name) <br /><span class="code-lines">41</span>}<br /></div><br /><br />When opening a model the error-message(s) pops up. (see attached)<br /><br />How do i define a reference attribute?<br /><br />Greetings,<br />Swante
Swante
2016-02-24T17:44:19Z