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

Brian G brian at westwoodsvcs.com
Wed Nov 18 11:55:54 CET 2020


No the entire script is turned into a project and compiled and executed
--
Thanks
Brian Tuesday, 17 November 2020, 00:16PM -08:00 from Bruce Steers  bsteers4 at gmail.com :

>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 ]----
>
>----[  http://gambaswiki.org/wiki/doc/netiquette ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20201118/60368424/attachment-0001.htm>


More information about the User mailing list