Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Interesting compile error
#4
(05-19-2025, 06:31 AM)RhoSigma Wrote: Which version of QB64-PE are you using:

Quote:DIM SHARED AS STRING segment(1).

REDIM _PRESERVE segment AS STRING.

REDIM _PRESERVE segment * 57 AS STRING.

The latter two lines are completly wrong, that's not the way how array (re)dimming works. If I paste the above lines into the IDE I immediatly get syntax errors and arn't even able to start compiling the code.

4.1.0.

Yes, I see that the redim dimension is missing in what I typed. My bad, it was late for me. I didn't copy the code. In the program the dimensions are there.

Initial declaration:                     DIM SHARED AS STRING wires(20), filename, segments(1) 

Doesn't cause compiler errors:    REDIM _PRESERVE AS STRING segments(iy)

Causes compiler errors:              REDIM _PRESERVE AS STRING * 57 segments(iy)

The point was that redimming as a fixed length string resulted in the compiler errors, but the IDE didn't flag that something was amiss.
It's not the having, it's the doing.
Reply


Messages In This Thread
Interesting compile error - by bobalooie - 05-19-2025, 02:25 AM
RE: Interesting compile error - by RhoSigma - 05-19-2025, 06:31 AM
RE: Interesting compile error - by bobalooie - 05-19-2025, 11:42 AM
RE: Interesting compile error - by RhoSigma - 05-19-2025, 02:34 PM
RE: Interesting compile error - by hsiangch_ong - 05-19-2025, 11:32 AM
RE: Interesting compile error - by PhilOfPerth - 05-19-2025, 12:10 PM
RE: Interesting compile error - by bplus - 05-19-2025, 06:14 PM
RE: Interesting compile error - by bobalooie - 05-20-2025, 12:12 PM
RE: Interesting compile error - by bplus - 05-20-2025, 02:27 PM



Users browsing this thread: 1 Guest(s)