Re: question on scope of a variable
From: Word Heretic (myfullname_at_tpg.com.au)
Date: 12/16/04
- Next message: Word Heretic: "Re: Rounding number UP"
- Previous message: Word Heretic: "Re: Protection Task Pane"
- In reply to: Chip Orange: "question on scope of a variable"
- Next in thread: Chip Orange: "Re: question on scope of a variable"
- Reply: Chip Orange: "Re: question on scope of a variable"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 16 Dec 2004 15:19:44 +1100
G'day "Chip Orange" <Chip.Orange@psc.state.fl.us>,
Accessible everywhere is not Static.
If I have a std code module and declare at the top of it, outside of
any sub
Public ICanSeeThisEverywhere as Variant
then that should be accessible to your form.
Steve Hudson - Word Heretic
steve from wordheretic.com (Email replies require payment)
Without prejudice
Chip Orange reckoned:
>I've tried declaring a public variable in a module of my project in hope
>that it can be accessible by any of the forms; I mean that I'd like a form
>to be able to initialize it, or have access to it's value if it's
>initialized by a routine in the modules section.
>
>While this compiles for me, I'm getting a runtime error that indicates the
>object variable isn't initialized when accessed by a form, but declared and
>initialized by a module.
>
>If I add a second initialization statement in the form itself then all runs
>ok.
>
>I obviously don't understand the scoping rules here, so could someone
>explain to me if it's possible to have a variable accessible everywhere
>(that is, have it be static?).
>
>I did try declaring it using the STATIC command in the module but the
>compiler wouldn't allow that.
>
>thanks.
>
>Chip
>
>
- Next message: Word Heretic: "Re: Rounding number UP"
- Previous message: Word Heretic: "Re: Protection Task Pane"
- In reply to: Chip Orange: "question on scope of a variable"
- Next in thread: Chip Orange: "Re: question on scope of a variable"
- Reply: Chip Orange: "Re: question on scope of a variable"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|