Page 1 of 1
VBDOS Scope, newbie question
Posted: Tue Jan 13, 2004 4:43 pm
by h8or
In VB for windows, we have these reserved words: "PRIVATE" and "PUBLIC".
But not in VBDOS.
So, how to make variables visible in all modules?
I need an Example.
Thank.
Re: VBDOS Scope, newbie question
Posted: Fri Jan 16, 2004 2:48 pm
by frankiebaby
use the SHARED keyword:
DIM SHARED Var AS INTEGER
DIM SHARED Var2 AS STRING * 5
DIM SHARED Var%
DIM SHARED Var2$
DIM SHARED Var3 AS DOUBLE
DIM SHARED Var3!
Re: VBDOS Scope, newbie question
Posted: Sun Jan 18, 2004 1:06 am
by h8or
No, wrong.
"DIM SHARED" doesn't work!
"COMMON SHARED" doen't work!
"COMMON" doen't work!
See part of my code:
------------------------------------
REM This is the "start file"
TYPE Registro
Name as STRING * 34
END TYPE
DIM SHARED People as Registro
------------------------------------
REM This is any form
SUB asdf_click
People.Name = "asdf"
END SUB
------------------------------------
The debugger say, People.Name is Single, not register
Re: VBDOS Scope, newbie question
Posted: Sun Jan 18, 2004 2:06 am
by h8or
Thank you Frankiebaby!
I found the right code.
In this faq, if anyone want to know:
http://www.dossolutions.pwp.blueyonder.co.uk/vbfaq.html
Thank you!
H8OR