Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Interesting problem with COMMON/DIM SHARED
#1
First of all, FB 0.11 rules big-time, except for this bug I seem to have come across (please tell me I'm doing something wrong, so I don't have to wait for 0.12 :-P)

I have these lines in my main include file (used by every module):

Code:
COMMON SHARED Layers() AS SDL_Surface POINTER
DIM SHARED Layers(1 TO 5) AS SDL_Surface POINTER

That compiles successfully, but any reference to the array at all crashes the program.

So I tried putting the dimensions in the COMMON...

Code:
COMMON SHARED Layers(1 TO 5) AS SDL_Surface POINTER
DIM SHARED Layers(1 TO 5) AS SDL_Surface POINTER

Also compiles fine, but crashes on any reference to Layers().

Lastly, just as a test, regardless of whether or not the array would be common, I tried:

Code:
DIM SHARED Layers(1 TO 5) AS SDL_Surface POINTER

This code worked fine when Layers() was referenced in engine.bas, my main module, but crashed when it was referenced in sdlwrap.bas, my graphics module. When I say "referenced," I mean used generally - I check the contents of Layers( ) with a PRINT statement as a sort of debugging, and the PRINT executes about halfway and crashes.

Tell me I'm doing something wrong. I'd love to continue programming. :-)

As a side note: it seems that if the array is dynamic, everything works fine - as is with my MainFont() array, my Tileset() array, and my Level() array.
color=blue]subxero - admin at this place.[/color]
Reply


Messages In This Thread
Interesting problem with COMMON/DIM SHARED - by subxero - 01-31-2005, 05:25 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)