# Variable Syntax Question

**URL:** <https://tech-community.robotics.abb.com/t/variable-syntax-question/8084>\
**Category:** RobotStudio\
**Created:** [February 6, 2018, 1:44pm UTC](https://tech-community.robotics.abb.com/t/variable-syntax-question/8084 "2018-02-06T13:44:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![EliteRobotique](https://avatars.discourse-cdn.com/v4/letter/e/e99b99/32.png) [@EliteRobotique](https://tech-community.robotics.abb.com/u/EliteRobotique)\
**Post date:** [February 6, 2018, 1:44pm UTC](https://tech-community.robotics.abb.com/t/variable-syntax-question/8084/1 "2018-02-06T13:44:31Z")

</div>

Hi everyone ! I have a simple question. Does it is possible to define each line of an array in one sentence

Here is the example :

VAR String Mot\_Controle{7,2};

!Définition des variables  
Data:=“”;  
Mot\_Controle{1,1}:=“PHP0”;  
Mot\_Controle{1,2}:=“Demande d’arrêt de la pompe”;  
Mot\_Controle{2,1}:=“PHP1”;  
Mot\_Controle{2,2}:=“Demande de basse Pression”;  
Mot\_Controle{3,1}:=“PHP2”;  
Mot\_Controle{3,2}:=“Demande de haute Pression”;  
Mot\_Controle{4,1}:=“PHP3”;  
Mot\_Controle{4,2}:=“Demande de départ de la pompe”;  
Mot\_Controle{5,1}:=“PHP4”;  
Mot\_Controle{5,2}:=“Demande d’état de la pompe”;  
Mot\_Controle{6,1}:=“PHP5”;  
Mot\_Controle{6,2}:=“Signal Robot au repos”;  
Mot\_Controle{7,1}:=“PHP6”;  
Mot\_Controle{7,2}:=“Signale Robot en Découpe”;

Does it is possible to define the 1,1 and the 1,2 on the same line ?

Thanks !

---

<div class="post-metadata">

**Author:** ![soup](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/soup/32/1592_2.png) [@soup](https://tech-community.robotics.abb.com/u/soup)\
**Post date:** [February 6, 2018, 2:19pm UTC](https://tech-community.robotics.abb.com/t/variable-syntax-question/8084/2 "2018-02-06T14:19:38Z")

</div>

VAR String anArray{7,2};  
anArray:=[[“”,“”],[“”,“”],[“”,“”],[“”,“”],[“”,“”],[“”,“”],[“”,“”]];

---

<div class="post-metadata">

**Author:** ![EliteRobotique](https://avatars.discourse-cdn.com/v4/letter/e/e99b99/32.png) [@EliteRobotique](https://tech-community.robotics.abb.com/u/EliteRobotique)\
**Post date:** [February 6, 2018, 3:26pm UTC](https://tech-community.robotics.abb.com/t/variable-syntax-question/8084/3 "2018-02-06T15:26:39Z")

</div>

Thanks !

There is an commande to find the position of a specific string within the array ? I can do it using a for loop but I’m looking for a simpler way

---

<div class="post-metadata">

**Author:** ![soup](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/soup/32/1592_2.png) [@soup](https://tech-community.robotics.abb.com/u/soup)\
**Post date:** [February 6, 2018, 3:30pm UTC](https://tech-community.robotics.abb.com/t/variable-syntax-question/8084/4 "2018-02-06T15:30:04Z")

</div>

Don’t think so – I always FOR loop to find.
