[Gambas-user] global variable

Tim Hanschen Tim.Hanschen at ...20...
Fri Jun 4 07:15:34 CEST 2004


With this GlobaVars module that was a good idea.... but now another problem raised. First of all I want to explain in more detail what I want to do.

I want to create an application which can be controlled via a touchscreen. I have several forms. One form is my "virtual keyboard". Whenever I have to enter text I call my virtual keyboard... I call the keyboard like this:

  DIM hNewForm AS Fkeyboard
  hNewForm = NEW Fkeyboard
  hNewForm.show

The problem is that I can enter a text, in my global variable, but the called form will not "notice" that the value has changed. It would be fine if the called form stops and waits until a text is entered and then go on...



gambas-user at lists.sourceforge.net schrieb am 03.06.04 16:58:43:

 --- Grahame White <grahame at ...457...>
escribió: > On Thursday 03 June 2004 12:28, Tim
Hanschen wrote:
> > Hi,
> >
> > I need a global variable which is "shared" between
> some forms... how can
> > I do it. I tried to pass a variable via _new, but
> it is too
> > complicated...
> >
> > Is there a possibility to define a variable that
> can be accessed in all
> > forms?
> >
> > regards,
> >   - Tim -

You can create a module (e.g: GlobalVars) which
contains public variables.  You should declare them
as:

public SomeThing as integer (if it is an integer)

Then, when you want to access the variable, you should
use:

GlobalVars.Something = Whateveryouwant

Hope it hepls you
> 
> 
> FFoo.class
> 
> PUBLIC SUB Button1_Click()
> 
> 	PRINT CBaz.bar
> 
> END SUB
> 
> 
> 
> 
> CBaz.class
> 
> PUBLIC bar as Integer
> 
> PUBLIC SUB _init()
> 
> 	bar = 10
> END SUB
> 
> 
> 
> Basically if you create a public variable in one
> file you can reference 
> that variable by explicitly stating which file the
> variable is in
> 
> Grahame
> 
> 
>
-------------------------------------------------------
> This SF.Net email is sponsored by the new
> InstallShield X.
> From Windows to Linux, servers to mobile,
> InstallShield X is the one
> installation-authoring solution that does it all.
> Learn more and
> evaluate today!
> http://www.installshield.com/Dev2Dev/0504
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
>
https://lists.sourceforge.net/lists/listinfo/gambas-user 


		
______________________________________________________________________
Correo Yahoo! - 6MB, más protección contra el spam ¡Gratis!
http://correo.yahoo.es


-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.


More information about the User mailing list