Re: Sharing variables across forms in same project?

Tech-Archive recommends: Fix windows errors by optimizing your registry



Thanks, Ken. I appreciate the boost.
Ed

"Ken Halter" <Ken_Halter@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:eEjU4%23GpGHA.4196@xxxxxxxxxxxxxxxxxxxxxxx
"Ed" <ed_millis@xxxxxxxxxxxxxxxxx> wrote in message
news:eEUoh7GpGHA.3936@xxxxxxxxxxxxxxxxxxxxxxx
Just to make sure I have this right - if I have a variable declared as
Public in the code of one form, the other form can read and write it,
too, yes? I will be dealing with strings, long counters, Boolean, and
arrays.

Ed

Public variables declared in a form become public properties of that form.
That means, from outside of the form, you'll need to prefix the variable
name with the form's instance name.

Form1:
Public Test As String

Form2:
Form1.Test = "ABC"
MsgBpx Form1.Test

--
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
In Loving Memory - http://www.vbsight.com/Remembrance.htm



.



Relevant Pages

  • Re: Sharing variables across forms in same project?
    ... I will be dealing with strings, long counters, Boolean, and arrays. ...
    (microsoft.public.vb.general.discussion)
  • Sharing variables across forms in same project?
    ... I will be dealing with strings, long counters, Boolean, and arrays. ...
    (microsoft.public.vb.general.discussion)
  • Re: Copying Similar Data Structures
    ... Since all my strings are fixed-length, do I need the SAFEARRAY stuff? ... I tried using a straight CopyMemory call and it seemed to work great. ... When finished I have array of new structure to write back to disk. ... > WeekOKAs Boolean ...
    (microsoft.public.vb.general.discussion)
  • Re: Set the CheckBox.Checked without the OnClick being called
    ... Such systems typically have only one set of boolean operators, working bitwise on integral values, and have no special boolean type. ... The requirement for the LongBool etc. Delphi data types comes from pseudo-boolean C subroutine arguments, where the caller expects the value encoded in a certain number of bytes, whereas a Delphi "boolean" would be passed only as a single byte. ... A StringBase option had been nice, introduced together with dynamic strings and. ...
    (comp.lang.pascal.delphi.misc)
  • Re: D7 Compiler Bug
    ... He's not dealing with records. ... > memory or file in a while record. ... OK, let's forget about strings. ... WideString, or a Variant, and then change the assertion test ...
    (comp.lang.pascal.delphi.misc)