Posts: 369
Threads: 71
Joined: Jul 2022
Reputation:
14
I have this sample code:
Common Shared Test() As String * 260
which in the status area displays
Cannot convert expression type to symbol
and I had to drill down to the function declaration using process of elimination to find.
Problem: the error does not state the line number it is in!
could this be fixed in a future mod of Qb64??
Thanks, Erik.
Posts: 1,586
Threads: 59
Joined: Jul 2022
Reputation:
52
Cannot use empty braces with "DIM", the compiler has to know the extent of the array. Avoid using "CHAIN" and "COMMON" in QB64PE. It worked well with "BRUN45" module but this is not the late 1980's anymore.
Posts: 2,171
Threads: 222
Joined: Apr 2022
Reputation:
103
COMMON SHARED was also used back in the QJurassic Era when you needed to pass variables to modules in multi-modular programs. Using multi-modular programming allowed for more than the 64K single module limit. I think I used to pull about 220K with that method. Note because memory was and still is allocated for different processes unevenly, it was darn near impossible to write a program that would end up being 256K.
Anyway, back to the point. Yes, whenever possible a line number should be reported by the IDE. Steve, when he is feeling better, or Matt may want to have a look at adding line number recognition.
Also, even with DIM SHARED, we have to define the elements in the array...
DIM SHARED test(100) AS STRING * 256
or ...
DIM SHARED test(0) AS STRING * 256
...and
REDIM test(100) ' Sometime later.
Unfortunately, arrays were not able to be made into types.
Pete