# Syntax for argument with '|' seperator

**URL:** <https://tech-community.robotics.abb.com/t/syntax-for-argument-with-seperator/8407>\
**Category:** UpFeed\
**Created:** [August 7, 2018, 12:33pm UTC](https://tech-community.robotics.abb.com/t/syntax-for-argument-with-seperator/8407 "2018-08-07T12:33:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![robotm](https://avatars.discourse-cdn.com/v4/letter/r/41988e/32.png) [@robotm](https://tech-community.robotics.abb.com/u/robotm)\
**Post date:** [August 7, 2018, 12:33pm UTC](https://tech-community.robotics.abb.com/t/syntax-for-argument-with-seperator/8407/1 "2018-08-07T12:33:35Z")

</div>

Hello,

for a procedure I need the possibility to combine two arguments with a OR character.  
With optional arguments it works fine, but I don’t wanna use optional arguments.

The following code is not accepted.

```auto
PROC SetValue(num Value **|** dnum Dvalue)
....
ENDPROC

```

I want the independence of the data type for calling SetValue.

```auto
VAR num Value;
VAR dnum Dvalue;

SetValue Value;
SetValue Dvalue;

```

I found a code example in the manuel for the procedure SetGo.

This is the syntax from the robotware manuel “technical reference manual - RAPID Instructions, Functions and Data types” on page 688.

```auto
SetGO
['\' SDelay ':=' < expression (IN) of num > ',']
[Signal ':='] < variable (VAR) of signalgo > ','
[Value ':='] < expression (IN) of num >
| [Dvalue' :='] < expression (IN) of dnum > ';'

```

I hope someone can help me.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Maxim](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/maxim/32/4429_2.png) [@Maxim](https://tech-community.robotics.abb.com/u/Maxim)\
**Post date:** [August 7, 2018, 1:05pm UTC](https://tech-community.robotics.abb.com/t/syntax-for-argument-with-seperator/8407/2 "2018-08-07T13:05:36Z")

</div>

Hello,

We’ve looked into this and because RAPID does not support overload you’ll have to ‘normalize’ the variable before you call the function. With normalize I mean convert to either num or dnum.

Consult the RAPID manual on how to do the conversion.

---

<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:** [August 7, 2018, 1:23pm UTC](https://tech-community.robotics.abb.com/t/syntax-for-argument-with-seperator/8407/3 "2018-08-07T13:23:52Z")

</div>

Interesting question! So, what kind of magic does the SetGO function have behind the scenes that it’s able to do the num or dnum without conversion?

---

<div class="post-metadata">

**Author:** ![robotm](https://avatars.discourse-cdn.com/v4/letter/r/41988e/32.png) [@robotm](https://tech-community.robotics.abb.com/u/robotm)\
**Post date:** [August 7, 2018, 1:40pm UTC](https://tech-community.robotics.abb.com/t/syntax-for-argument-with-seperator/8407/4 "2018-08-07T13:40:44Z")

</div>

Hello Maxim Riabichev,

thank you for your response!

I know the conversion function, but from a programmer’s point of view it would be fantastic if two non-optional arguments could be combine with “or”.

The SetGo command illustrates the advantages!

I think it would be great if this possibility would be added in a future robotware update.

---

<div class="post-metadata">

**Author:** ![Maxim](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/maxim/32/4429_2.png) [@Maxim](https://tech-community.robotics.abb.com/u/Maxim)\
**Post date:** [August 7, 2018, 1:53pm UTC](https://tech-community.robotics.abb.com/t/syntax-for-argument-with-seperator/8407/5 "2018-08-07T13:53:10Z")

</div>

Hello,

Okay I’ll have a talk with my collegues tomorrow.

---

<div class="post-metadata">

**Author:** ![Maxim](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/maxim/32/4429_2.png) [@Maxim](https://tech-community.robotics.abb.com/u/Maxim)\
**Post date:** [August 8, 2018, 6:18am UTC](https://tech-community.robotics.abb.com/t/syntax-for-argument-with-seperator/8407/6 "2018-08-08T06:18:49Z")

</div>

Hello,

So we’ve spoken about this matter and we’ve reached the conclusion that the best would be if RAPID would support Overload, like C# does for example.

I will move this thread to the UpFeed section (as a suggestion for future addition to RAPID).

---

<div class="post-metadata">

**Author:** ![robotm](https://avatars.discourse-cdn.com/v4/letter/r/41988e/32.png) [@robotm](https://tech-community.robotics.abb.com/u/robotm)\
**Post date:** [August 8, 2018, 8:58am UTC](https://tech-community.robotics.abb.com/t/syntax-for-argument-with-seperator/8407/7 "2018-08-08T08:58:45Z")

</div>

Hello,

Glad to hear it.  
Thanks for everything.

Kind regards
