Definir une stucture

Bonjour, Je cherche comment dclarer la structure Point3 pour etre utilise dans le calcul vectoriel, sous Vb6 ctait comme a:

[code]Public Type Point3
X As Double
Y As Double
Z As Double
End Type

Public Function Norme(Vecteur As Point3) As Double
Norme = Sqr(Vecteur.X ^ 2 + Vecteur.Y ^ 2 + Vecteur.Z ^ 2)
End Function[/code]

J’ai cre la Fonction Norme(Vecteur as Point3) dans Xojo, j’ai dclar Point3 dans mthode - structure, mais a ne donne rien.

You have to define a structure in an class, module, window … where is better for your needs
(Use the blu box menu is the last command)
Here you set the name (Point3)
The scope (Public)
and add the 3 components (X, Y and Z)

Then you can add the function:
Function Norme(Vecteur As Point3) As Double
return Sqrt(Vecteur.X ^ 2 + Vecteur.Y ^ 2 + Vecteur.Z ^ 2)
End Function

Note you have to use return to return a value not the function name as in VB

hello Antonio,
Still does not work, i have attached IDE screen shot to show you how i have proceed:

It’s Ok Now, I have just forget to declare Vect as point3.
thank you Antonio.