Global variable from source file to main program

Previous topic - Next topic

ocmar

Hi, I'm new here :)

My question is: is it possible to use global variable from addon source file in main source file?
In global.gbas I have:
Code (glbasic) Select
GLOBAL K_ESC% = 01
GLOBAL app_state%

and I use it in main file app01.gbas:
Code (glbasic) Select
IF app_state% = APP_RUN% THEN PRINT "App Run", 10, 10
In output window I have:
"app01.gbas"(17) error : variable is not explicitly defined : app_state.
I don't find answer on the forum.

PS. Sorry for bad English

Edit: Ok, sorry, I'm stupid ;)
In top of app01.gbas now i have:
Code (glbasic) Select
GLOBAL K_ESC%
GLOBAL app_state%

and it's work. This looks like a extern i C :).