Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TYPE as argument of a function

Status
Not open for further replies.

alberto7783

Technical User
May 12, 2000
1
ES
Hello !!!<br>I'm just trying to make a project that with a Module where I define the Type Complex an a Public Function to add complex numbers as:<br><br>Type Complex<br>real as double<br>imaginary as double<br>End Type<br><br>-----------------<br>Public Function AddComplex(a as Complex, b as Complex) as Complex<br><br>Dim aux as Complex<br><br>aux.real=a.real+b.real<br>aux.imaginary=a.imagirary + b.imaginary<br><br>AddComplex=aux<br><br>End Function<br><br>-------------<br>But when I execute this function in a Form with a Command button trying to add two Complex numbers there is an error pointing to the function.<br><br><br>THE QUESTION IS:<br>Does anybody know if it's possible use type objects as arguments of functions?<br><br><br>
 
Yes, it's possible.&nbsp;&nbsp;The only thing I see wrong with your code is you spelled imaginary wrong in this line:<br><br>aux.imaginary=a.imagirary + b.imaginary <p>nick bulka<br><a href=mailto:nick@bulka.com>nick@bulka.com</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top