Assignment message including variable value

Hi, is there a way to have the text shown from an Operator Message in an Operator Assignment display the value of a variable?

Eg The current position is “5” continue? Yes/No Assignment where the value 5 is being obatined from a variables current value.

Or is their a URScript that could acheive the same/similiar? I have found a script for a popup displaying a variable but really need it in an assignment so the operator can make a decision based on the current value.

Thanks for your help.

Hi @andrew2

Welcome to the UR forum!

Yes. you can have a text that show the value of a variable.
The script function to_str() will do the job of converting the value to a string. You can then use str_cat() to compose the complete string for your message and pass it to the request_boolean_from_primary_client() function.

Your concrete sample is put toghether here:

value = 5
operator_bool = request_boolean_from_primary_client(str_cat("The current position is '", str_cat(to_str(value), "' continue?")))

Ebbe

3 Likes

Fantastic, just what I was looking for, Thanks Ebbe!

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.