Compound strings/variable declaration

Previous topic - Next topic

MrTAToad

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$

Quentin

I guess $ is not part of the variable name, so you defined "country" twice.

MrTAToad

Yes, that was the conclusion I can to too.  However, in that case, the compiler should generate an error message...

Kitty Hello


MrTAToad

However, doing :

Code (glbasic) Select

path$=country$
INC path$," "


Works :/

MrTAToad

This is a small example :

Code (glbasic) Select
TYPE tTest
moo%
ENDTYPE

LOCAL test AS tTest
LOCAL test$,temp$

temp$=test$+" "