Stuck with realbasic 
Author Message
 Stuck with realbasic

Hi,
I'm new to real basic.
I'm used to programming in foxpro Etc,but don't understand how to have
global variables

I have an number of methods to read/write adatabase to the screen, but
must maintain a global data area.
E.G
I read the database of supplier names into the list on screen, but then
must maintain an array/collection of supplier indexes.
which are then used to find the supplier invoices once a supplier is
selected.

I've tried defining the arrays in the open event of the screen, but when
it exits, I loose the global defs ( of course!).

is there no event loop in real basic, so that you can define the globals
but maintain them whilst the window is open?

THANKS

steve



Wed, 30 Jul 2003 17:11:40 GMT  
 Stuck with realbasic

Quote:

> Hi,
> I'm new to real basic.
> I'm used to programming in foxpro Etc,but don't understand how to have
> global variables

> I have an number of methods to read/write adatabase to the screen, but
> must maintain a global data area.
> E.G
> I read the database of supplier names into the list on screen, but then
> must maintain an array/collection of supplier indexes.
> which are then used to find the supplier invoices once a supplier is
> selected.

> I've tried defining the arrays in the open event of the screen, but when
> it exits, I loose the global defs ( of course!).

> is there no event loop in real basic, so that you can define the globals
> but maintain them whilst the window is open?

> THANKS

> steve

Page 112 of Language Reference.
Create a module and every variable created with Dim is a global variable.
I am also new not only in RB but in programming as such. It is a
headache but so much fun.

Regards

Alex

--
Just for fun:
http://homepage.mac.com/ZorbasAlex/show.html



Wed, 30 Jul 2003 18:35:33 GMT  
 Stuck with realbasic

Quote:
>Page 112 of Language Reference.
>Create a module and every variable created with Dim is a global variable.
>I am also new not only in RB but in programming as such. It is a
>headache but so much fun.

I dont believe that's true.  Yes you need a module, but in order for the
variable to be global, it needs to be a property of the module, if it's dim'ed
its gonna be local only to the function it was dim'ed in.


Fri, 01 Aug 2003 07:10:41 GMT  
 Stuck with realbasic
HI,

yes I found it, but it is hardly clear.

however I have managed to sort it out, but now I'm onto the next
problem.

Quote:


> > Hi,
> > I'm new to real basic.
> > I'm used to programming in foxpro Etc,but don't understand how to have
> > global variables

> > I have an number of methods to read/write adatabase to the screen, but
> > must maintain a global data area.
> > E.G
> > I read the database of supplier names into the list on screen, but then
> > must maintain an array/collection of supplier indexes.
> > which are then used to find the supplier invoices once a supplier is
> > selected.

> > I've tried defining the arrays in the open event of the screen, but when
> > it exits, I loose the global defs ( of course!).

> > is there no event loop in real basic, so that you can define the globals
> > but maintain them whilst the window is open?

> > THANKS

> > steve

> Page 112 of Language Reference.
> Create a module and every variable created with Dim is a global variable.
> I am also new not only in RB but in programming as such. It is a
> headache but so much fun.

> Regards

> Alex



Sun, 03 Aug 2003 07:42:54 GMT  
 Stuck with realbasic

hi,
yes it  does have to be a property , and its' got to be dimed in the
root calling module , if it's dimmed in a method, it does ot appear to
be global.

steve

Quote:

> >Page 112 of Language Reference.
> >Create a module and every variable created with Dim is a global variable.
> >I am also new not only in RB but in programming as such. It is a
> >headache but so much fun.

> I dont believe that's true.  Yes you need a module, but in order for the
> variable to be global, it needs to be a property of the module, if it's dim'ed
> its gonna be local only to the function it was dim'ed in.



Sun, 03 Aug 2003 08:09:34 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. From Hickory Sticks to Joy Sticks

2. Sound in RealBasic 4 Prof. (er, RealBasic)

3. Matching Data Types between RealBasic and the RealBasic Database

4. realbasic to excel/realbasic vers excel

5. Stuck with ApplicationModel

6. Newbie Parsing Question...STUCK

7. Stuck on Snooze!

8. Deliberation topic: stuck while developing

9. headless application sometimes stuck hogging CPU

10. Stuck in the menus

11. A general framework for ball and stick / graph editors

12. PRESSKEY statement causing Alt key to get stuck

 

 
Powered by phpBB® Forum Software