Author Topic: Defining DIM outside from main  (Read 3065 times)

Offline Albert

  • Dr. Type
  • ****
  • Posts: 257
    • View Profile
    • Blog
Defining DIM outside from main
« on: 2008-Mar-04 »
if you defining DIM outside from MAIN (I mean from an include gpas file or after some function) then you get strange compiler messages like '{' not expected in ...cpp and a message to please copy these errorcodes to the glBasic forums.
The preprocessor sould be fixed to prevent .cpp making if DIM defined in the wrong place

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10762
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Defining DIM outside from main
« Reply #1 on: 2008-Mar-04 »
Code: (glbasic) [Select]
FUNCTION foo:
ENDFUNCTION

DIM a[5] // like this??

Offline Albert

  • Dr. Type
  • ****
  • Posts: 257
    • View Profile
    • Blog
Defining DIM outside from main
« Reply #2 on: 2008-Mar-04 »
Yes.
I tried your code: gcc freezed :D

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10762
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Defining DIM outside from main
« Reply #3 on: 2008-Mar-04 »
fixed.