- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So, i've got some pretty big code which has to be done all the time, so i wanted to make a function of it.
Now, I've learned how to create functions, but the problem is, the function definition looks like this:
Function middelpunttussendwarslijnen(nlba As AcadLWPolyline, dlba1, dlba2 As AcadLine, sn1, sn2 As Integer) As Variant
I want 3 outputs, for your information: the x & y value of a certain coordinate, and the nr. of the coordinate.
So, I was hoping, by using the positions (0, 1, 2) in the variant, 0 & 1 could be x & y, and 2 the nr.. But, when definining the 0,1,2, by
middelpunttussendwarslijnen(0) = nieuweindpunt(0) middelpunttussendwarslijnen(1) = nieuweindpunt(1) middelpunttussendwarslijnen(2) = sn1 + x - 2
it gives me a type mismatch.
It would be an really awful solution to just do all the code twice in 2 different functions, 1 for the coordinate and 1 for the nr., so i was hoping there exists a more elegant solution.
anybody got any ideas? thanks.
Solved! Go to Solution.