GLBasic forum

Main forum => Bug Reports => Topic started by: MrTAToad on 2010-Dec-07

Title: Compound strings/variable declaration
Post by: MrTAToad on 2010-Dec-07
I've been wondering why the following :

Code (glbasic) Select
temp$=country$+" "

produced :

Quoteerror : wrong argument type :

It turns out I have the following variables defined :

Code (glbasic) Select
LOCAL country AS tCountry
LOCAL path$,temp$,found%,countryCode%,country$,defLanguage$


I believe its using country (as tCountry) instead of country$
Title: Re: Compound strings/variable declaration
Post by: Quentin on 2010-Dec-07
I guess $ is not part of the variable name, so you defined "country" twice.
Title: Re: Compound strings/variable declaration
Post by: MrTAToad on 2010-Dec-07
Yes, that was the conclusion I can to too.  However, in that case, the compiler should generate an error message...
Title: Re: Compound strings/variable declaration
Post by: Kitty Hello on 2010-Dec-07
oh, that's bad.
Title: Re: Compound strings/variable declaration
Post by: MrTAToad on 2010-Dec-07
However, doing :

Code (glbasic) Select

path$=country$
INC path$," "


Works :/
Title: Re: Compound strings/variable declaration
Post by: MrTAToad on 2010-Dec-09
This is a small example :

Code (glbasic) Select
TYPE tTest
moo%
ENDTYPE

LOCAL test AS tTest
LOCAL test$,temp$

temp$=test$+" "