Author Topic: cannot convert expression type to symbol  (Read 188 times)

cannot convert expression type to symbol
« on: July 04, 2018, 07:24:17 AM »
Hello all,

I use QB64 to convert an old QB45 program to new windows environment.
All steps are debugged but now I receive the next message
'cannot convert expression type to symbol'
how can I debug this one ?
and where to look ?

thanks,
marc
I love 3D stuff - and building small robots
www.marc-systems.be

Offline johnno56

  • Live long and prosper.
Re: cannot convert expression type to symbol
« Reply #1 on: July 04, 2018, 08:38:17 AM »
Hi Marco. May I call you Marco?

First thing, welcome to the Forum. I hope that your time with us will be helpful for all.

I think the best way to help you with your problem would be to provide us with a sample of the code you are using.

Cheers.

J
Logic is the beginning of wisdom.

Re: cannot convert expression type to symbol
« Reply #2 on: July 04, 2018, 09:51:33 AM »
Welcome Marco,

Bummer when there is no line number with the error message...

You know expressions are like the stuff on the right side of equals sign.

And you know symbols are one or two or a few characters to represent usual a type of variable but also some binary functions but the error message is talking about a type,

you might get such a message  for
x% = "I am a string not an integer!"

or
x$ = 1 + 2

Show the code and the error could likely be spotted immediately (unless huge amount).
B = B + ...
QB64 x 64 v1.2 2018 0228/86 git b30af92
QB64 v1.2 20180228/86 git 6fde149
QB64 v1.2 [dev build]_d84bb00

Re: cannot convert expression type to symbol
« Reply #3 on: July 04, 2018, 10:04:00 AM »
OK so modify has a timer in editor too! curses foiled again!

Hi Marco,

So the above error producing lines I offered are being caught in IDE, red-lined! Are you using the QB64 IDE Marco?

If the code is old and working QB45, maybe there is a type symbol in QB45 not compatible with QB64, a place to start looking?

Are you declaring any TYPE in your code?

B = B + ...
QB64 x 64 v1.2 2018 0228/86 git b30af92
QB64 v1.2 20180228/86 git 6fde149
QB64 v1.2 [dev build]_d84bb00

Re: cannot convert expression type to symbol
« Reply #4 on: July 04, 2018, 05:21:40 PM »
Hello,

thanks for helping me with my problem ...

my program is about 5000 lines long,
what I did is cutting lines one by one,
first all lines I did not needed in my main base program ...
Then line by line, and still had the error message,
No red colored lines in the source to see ...

Till there was only 50 lines of my declarations left ...

and after cutting them again on by one, I found this error

COMMON SHARED DocNr() AS STRING * 4

I changed this in ...

DIM SHARED DocNr(1) AS STRING * 4

And Yes Yes Yes, it works OK
I lost some hours but I learned a lot ...

greetings,
marco


I love 3D stuff - and building small robots
www.marc-systems.be

Offline johnno56

  • Live long and prosper.
Re: cannot convert expression type to symbol
« Reply #5 on: July 04, 2018, 06:41:21 PM »
Sounded like a LOT of work. Glad it worked out ok for you.

J
Logic is the beginning of wisdom.

Re: cannot convert expression type to symbol
« Reply #6 on: July 04, 2018, 06:44:16 PM »
Hi Marco,

Interesting problem, my editor won't let me write
DIM a() as string * 4

It always removes the ()'s.

Be careful, if you actually did need COMMON for the array.

My editor allows this:
Code: [Select]

but that might not be good either?
COMMON SHARED DocNr()

DIM SHARED DocNr(1) AS STRING * 4


DocNr(1) = "Doc1"
PRINT DocNr(1)
« Last Edit: July 04, 2018, 06:46:04 PM by bplus »
B = B + ...
QB64 x 64 v1.2 2018 0228/86 git b30af92
QB64 v1.2 20180228/86 git 6fde149
QB64 v1.2 [dev build]_d84bb00

Re: cannot convert expression type to symbol
« Reply #7 on: July 04, 2018, 06:46:47 PM »
Modify the above, that might not be good either!
B = B + ...
QB64 x 64 v1.2 2018 0228/86 git b30af92
QB64 v1.2 20180228/86 git 6fde149
QB64 v1.2 [dev build]_d84bb00