AnsweredAssumed Answered

Returning multiple values from a function

Question asked by Harold Black on May 25, 2018
Latest reply on May 27, 2018 by Artem Taturevych

I have created a custom function named Create_pt in my code in which it calculates a x coordinate and y coordinate, xpt and ypt respectively. The reason for using a function is because I reuse the same block of code elsewhere. How do I return the values for xpt and ypt from the function? The help file said that if I want to return a value from the function I assign the value to the function name. Within my function I did Create_pt(0)=xpt

Create_pt(1)=ypt

 

In my main code I reference these values just by doing Create_pt(0) or Create_pt(1) but when I run my main code I get "Argument not optional" and it points to the location where I have tried this. What am I doing wrong? I can't seem to find an example of passing a variant out.

Outcomes