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
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.