Strings and arrays using GRAPHREPStrings and arrays using GRAPHREPRE: Strings and arrays using GRAPHREPWilfrid Utzhttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=3551992015-08-06T08:51:15Z2015-08-06T08:51:15ZThe proposal would be to use (LEO) Expression within the GRAPHREP and represent the result of these expressions. A brief example can be seen below, applying the String token functions (see the definition <a href="http://www.adoxx.org/live/expressions">here</a>) and control logic in GRAPHREP<br /><br />Assuming the STRING in t1 looks somewhat like this:<br />"A <strong>AND </strong>B <strong>OR </strong>C <strong>AND </strong>D <strong>XOR </strong>F <strong>OR </strong>G <strong>AND </strong>K..."<br /><br />you can write the following within the GRAPHREP to retrieve the number of ANDs<br /><br /><div class="code"><span class="code-lines">1</span>SET t1:"A AND B OR C AND D XOR F OR G AND K"<br /><span class="code-lines">2</span>SET andCount:0<br /><span class="code-lines">3</span>FOR word in: (t1) {<br /><span class="code-lines">4</span> IF (word = "AND") {<br /><span class="code-lines">5</span> SET andCount: (andCount+1)<br /><span class="code-lines">6</span> }<br /><span class="code-lines">7</span>}<br /><span class="code-lines">8</span>TEXT (STR andCount) x:-1.5cm y:0.01cm w:c h:c<br /></div><br />A similar logic can be applied for OR, XORs by extending the IF condition within the loop and adding to the counter.Wilfrid Utz2015-08-06T08:51:15ZStrings and arrays using GRAPHREPFadi Al Machothttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=3543902015-08-03T18:15:39Z2015-08-03T18:15:39ZSuppose, we have the following code, we know that this question can be done using ADO script, but we would like to know if it is possible to be done in GRAPHREP,<br /><br />GRAPHREP sizing:asymmetrical<br />AVAL t1:"Pre Condition"<br />AVAL t2:"Post Condition"<br />AVAL t3:"Pre Condition Label"<br />AVAL t4:"Post Condition Label"<br />PEN color:$F59D56 w:pt<br />FILL color:$EEF2F8<br />ELLIPSE x:0.00cm y:0cm rx:2cm ry:0.75cm<br />LINE x1:1.1cm x2:1.1cm y1:-0.6cm y2:0.6cm<br />LINE x1:-1.1cm x2:-1.1cm y1:-0.6cm y2:0.6cm<br />ATTR "Title" x:-.92cm y:-.5cm w:2cm h:t line-break:words<br />ATTR "Pre Condition Label" x:-1.5cm y:0.01cm w:c h:c<br />ATTR "Post Condition Label" x:1.5cm y:0.02cm w:c h:c<br /><br />IF ((t1 != ""))<br />{<br />PEN color:$F59D56 w:pt<br />FILL color:$EEF2F8<br />ELLIPSE x:0.00cm y:0cm rx:2cm ry:0.75cm<br />LINE x1:1.1cm x2:1.1cm y1:-0.6cm y2:0.6cm<br />LINE x1:-1.1cm x2:-1.1cm y1:-0.6cm y2:0.6cm<br />POINT x:-1.5cm y:0.0cm<br />ATTR "Title" x:-.92cm y:-.5cm w:2cm h:t line-break:words<br />ATTR "Pre Condition Label" x:-1.5cm y:0.01cm w:c h:c<br />ATTR "Post Condition Label" x:1.5cm y:0.02cm w:c h:c<br />}<br /><br />Please, we need an example which takes the content of the field in "t1" as a STRING and split it by logical operators "AND", "OR" and "XOR" and returns the number of "AND", "OR" and "XOR" operators.Fadi Al Machot2015-08-03T18:15:39Z