[Gambas-user] Gambas scripting, Type mismatch error.

Bruce Steers bsteers4 at gmail.com
Tue Nov 17 21:15:46 CET 2020


Thanks.
the documentation for gbs3 scripting is hard to find.

Would it be right to assume then when scripting every command is passed
like an Eval command?

Bruce


On Tue, 17 Nov 2020 at 19:24, <vuott at tiscali.it> wrote:

> I suggest:
>     http://gambaswiki.org/wiki/cat/evalorder
>
>
> Il 17.11.2020 19:03 Bruce Steers ha scritto:
> > Is this a bug in the scripter or bad coding technique on my part?...
> > getting a type mismatch error if i do not wrap variables in
> > parentheses?
> >
> > doesnt happen like this in normal gambas exe.
> >
> > If I use code like the following in a gbs script...
> >
> > Dim iVal As Integer = 1
> >
> > Print iVal   This prints 1
> >
> > Print iVal + 1  this prints 2
> >
> > Print "Val = " & iVal   this prints Val = 1
> >
> > Print "Val = " & iVal + 1
> >
> >  This gives the following error..
> >
> >  MMain.?.0: #6: Type mismatch: wanted Float, got String instead
> >
> > Print "Val = " & (iVal + 1)   this works and prints i = 2
> >
> > Cheers
> > BruceS
>
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20201117/75c53f7d/attachment.htm>


More information about the User mailing list