[Gambas-user] A little thing about function parameters

Fabien Bodard gambas.fr at ...626...
Sun Nov 23 12:38:06 CET 2008


Hi Benoit,

It's a think i've seen since many time..



'Class Tmenu

Public sub _New (sText as String, sLink as String, OPTIONAL hParent as
Tmenu, OPTIONAL aAutoSelect as String[])

  Text = sText
  {Link} = sLink

  IF aAutoSections.Exist(Request["section"]) THEN ME.IsSelected = TRUE

  IF NOT IsNull(hParent) THEN hParent.Children.Add(ME)

End

Well, the problem is i can't call this by this way


    Dim hMenu as Tmenu

    hMenu = NEW Tmenu("Sommaire", "/",, ["index"])

I need in fact write this :

    hMenu = NEW Tmenu("Sommaire", "/", NULL, ["index"])


in VB it is possible and the both are simple to read i think.

Why the compiler does not take care about that ?

Best regards,

Fabien Bodard




More information about the User mailing list