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

0 Members and 1 Guest are viewing this topic.

Offline MarcoPajotter

  • Newbie
  • Posts: 6
    • View Profile
cannot convert expression type to symbol
« on: July 04, 2018, 06: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
- every professional was once an amateur - greetings from Pajottenland - Belgium -
I love building small robots
PS: sorry for my english I speak flemish ...

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: cannot convert expression type to symbol
« Reply #1 on: July 04, 2018, 07: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.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: cannot convert expression type to symbol
« Reply #2 on: July 04, 2018, 08: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).

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: cannot convert expression type to symbol
« Reply #3 on: July 04, 2018, 09: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?


Offline MarcoPajotter

  • Newbie
  • Posts: 6
    • View Profile
Re: cannot convert expression type to symbol
« Reply #4 on: July 04, 2018, 04: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


- every professional was once an amateur - greetings from Pajottenland - Belgium -
I love building small robots
PS: sorry for my english I speak flemish ...

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: cannot convert expression type to symbol
« Reply #5 on: July 04, 2018, 05:41:21 pm »
Sounded like a LOT of work. Glad it worked out ok for you.

J
Logic is the beginning of wisdom.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: cannot convert expression type to symbol
« Reply #6 on: July 04, 2018, 05: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: QB64: [Select]
  1.  
  2. but that might not be good either?
  3. COMMON SHARED DocNr()
  4.  
  5. DIM SHARED DocNr(1) AS STRING * 4
  6.  
  7.  
  8. DocNr(1) = "Doc1"
  9. PRINT DocNr(1)
  10.  
« Last Edit: July 04, 2018, 05:46:04 pm by bplus »

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: cannot convert expression type to symbol
« Reply #7 on: July 04, 2018, 05:46:47 pm »
Modify the above, that might not be good either!