[Gambas-user] Gambas IDE 1.9.49-2 New Function formating.

Andreas Kostyrka yacc143 at ...626...
Wed Jun 27 20:55:24 CEST 2007


Ok, try to enter a function New function call (New is a standard function,
I've included a link to the documentation of it).

The IDE turns it into a uppercase NEW operator call that is invalid.

Andreas

2007/6/26, ron <ronstk at ...239...>:
>
> On Tuesday 26 June 2007 11:41, Andreas Kostyrka wrote:
> > Nope, as I've pointed out already, NEW is an operator. New is a
> function.
> >
>
> If your 'New' is a _function_, I must assume it is made by you in your
> code.
>
> As the syntax give examples as:
>
> a)  hButton = New("Button", hParent) ' or
> b)  Button = NEW Button(ME) AS "MyButton" ' or
> c)  DIM iMyArray AS NEW Integer[] ' and this one
>
> 'New' here is not a simple function but a constructor method and
> returns a object, yes functions returns something to. (the way i see)
>
> Did you made a function yourself as:
>
>    FUNCTION New(sString,vArgs)
>    dim iTmp as INTEGER
>     itmp=CINT(sNumber)
>     iTmp=iTmp+iNumber
>     return iTmp
>   END
>
> Beside both New' and NEW' are reserved words in gambas and the example
> function above should even normally not be allowed to make yourself.
>
> Simply as your previous code is $entries.Add(New("ABC", arg1))
> you do not tell exact what you want.
> I assume "ABC" is just typing something but it is not unimportant.
>
>
> The "ABC" argument should be a control or data type or results to it.
> There is no control named "ABC" or data type with that id.
>
> The only conclusion is that you made yourself the function 'New'
> which clashes with the reserved keywords in gambas.
> Gambas can only highlight/beautify the code as is done
>
>   $entries.Add(New("ABC", arg1)) ' you try syntax rule 'a'
>
> gets changed by the IDE to
>
>   $entries.Add( NEW ("ABC", arg1)) ' because function New("a",b) can't
>
> What happen if you do $entries.Add(New("Button", arg1)) ?
>
> As I suggest previous, do it with two lines and this complex
> construction could/should be solved.
>
> Lets wait what Benoit say more about it. I can be wrong to :(
>
>
> Ron
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



More information about the User mailing list