public declarations (REALbasic getting started Mailinglist archive)
Back to the thread list
Previous thread: GetInfo, Icon and version
Next thread: Sheet Window question
| public declarations |
| Date: 23.08.06 11:01 (Wed, 23 Aug 2006 06:01:07 -0400 (EDT)) |
| From: Steven Hedgepeth |
|
When using VB, I placed public variables and constants in the .bas module. I tried unsuccessfully to find an RB example that used public declarations. Is it correct to place them in a module and what are modules usually named? Can someone point out an example that shows how to use public declarations? Are they referred to as public or global in RB? Sincerely, Steven Hedgepeth _______________________________________________ Join Excite! - http://www.excite.com The most personalized portal on the Web! _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives of this list here: <http://support.realsoftware.com/listarchives/lists.html> |
| RE: public declarations |
| Date: 23.08.06 11:28 (Wed, 23 Aug 2006 06:28:12 -0400 (EDT)) |
| From: Steven Hedgepeth |
|
Ok, I found where constants go but what about public variables? Steve When using VB, I placed public variables and constants in the .bas module. I tried unsuccessfully to find an RB example that used public declarations. Is it correct to place them in a module and what are modules usually named? Can someone point out an example that shows how to use public declarations? Are they referred to as public or global in RB? _______________________________________________ Join Excite! - http://www.excite.com The most personalized portal on the Web! _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives of this list here: <http://support.realsoftware.com/listarchives/lists.html> |
| Re: public declarations |
| Date: 23.08.06 12:11 (Wed, 23 Aug 2006 13:11:31 +0200) |
| From: Trausti Thor Johannsson |
|
Create a module. Add properties (variables), and make sure the
variables are global (blue globe). And then they are global. I name my modules depending on what they do. For example, in a single window app, I name one module 'modDB' and another one is just named module1. Trausti On 23.8.2006, at 12:28, Steven Hedgepeth wrote: > > Ok, I found where constants go but what about public variables? > Steve > > When using VB, I placed public variables and constants in the .bas > module. I tried unsuccessfully to find an RB example that used > public declarations. Is it correct to place them in a module and > what are modules usually named? Can someone point out an example > that shows how to use public declarations? Are they referred to as > public or global in RB? > > _______________________________________________ > Join Excite! - http://www.excite.com > The most personalized portal on the Web! > > _______________________________________________ > Unsubscribe or switch delivery mode: > <http://www.realsoftware.com/support/listmanager/> > Search the archives of this list here: > <http://support.realsoftware.com/listarchives/lists.html> _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives of this list here: <http://support.realsoftware.com/listarchives/lists.html> |
| Re: public declarations |
| Date: 23.08.06 17:46 (Wed, 23 Aug 2006 09:46:31 -0700) |
| From: Dave Wooldridge |
|
If you don't want to clutter the namespace of your app and risk conflicting
names, you can also mark the variables in your module as Protected. You then refer to them from anywhere in your app with the module's name listed before the variable. For example, if your module name is "MyGlobals" and your Protected string variable is "mUsername", you can access that variable with the following example syntax: EditField1.Text yGlobals.mUsername Regards, Dave Wooldridge Electric Butterfly http://www.ebutterfly.com ---------------------------------------- RB Garage - http://www.RBGarage.com The largest independent online resource For REALbasic software developers! ---------------------------------------- > Create a module. Add properties (variables), and make sure the > variables are global (blue globe). And then they are global. > > I name my modules depending on what they do. For example, in a > single window app, I name one module 'modDB' and another one is just > named module1. > > Trausti > > On 23.8.2006, at 12:28, Steven Hedgepeth wrote: > >> >> Ok, I found where constants go but what about public variables? >> Steve >> >> When using VB, I placed public variables and constants in the .bas >> module. I tried unsuccessfully to find an RB example that used >> public declarations. Is it correct to place them in a module and >> what are modules usually named? Can someone point out an example >> that shows how to use public declarations? Are they referred to as >> public or global in RB? >> >> _______________________________________________ >> Join Excite! - http://www.excite.com >> The most personalized portal on the Web! >> >> _______________________________________________ >> Unsubscribe or switch delivery mode: >> <http://www.realsoftware.com/support/listmanager/> >> >> Search the archives of this list here: >> <http://support.realsoftware.com/listarchives/lists.html> > _______________________________________________ > Unsubscribe or switch delivery mode: > <http://www.realsoftware.com/support/listmanager/> > Search the archives of this list here: > <http://support.realsoftware.com/listarchives/lists.html> _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives of this list here: <http://support.realsoftware.com/listarchives/lists.html> |
| Re: public declarations |
| Date: 23.08.06 20:30 (Wed, 23 Aug 2006 13:30:32 -0600) |
| From: joe strout.net |
|
On Aug 23, 2006, at 19:11 UTC, Keith Bennett wrote:
> One annoying fact with regards to namespace cluttering/confusion is that if > you mark the property/method/function/whatever as "private", then you can > not access it from within the module itself via Module1.MyMethod(), which > means it could confuse some namespace stuff. Not really, since name scopes are searched inside-out -- i.e., just use MyMethod, and it's going to search Module1 before looking anywhere else anyway. The only thing that could override it is a local variable. Best, - Joe |
| Re: public declarations |
| Date: 23.08.06 21:47 (Wed, 23 Aug 2006 16:47:55 -0400) |
| From: Charles Yeomans |
|
On Aug 23, 2006, at 3:30 PM, <email address removed> wrote: > On Aug 23, 2006, at 19:11 UTC, Keith Bennett wrote: > >> One annoying fact with regards to namespace cluttering/confusion is > that if >> you mark the property/method/function/whatever as "private", then you > can >> not access it from within the module itself via Module1.MyMethod(), > which >> means it could confuse some namespace stuff. > > Not really, since name scopes are searched inside-out -- i.e., just > use > MyMethod, and it's going to search Module1 before looking anywhere > else > anyway. The only thing that could override it is a local variable. Or a method in another module; there are some long-standing problems with modules, namespace confusion, and privacy. Charles Yeomans _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives of this list here: <http://support.realsoftware.com/listarchives/lists.html> |
Links
MBS REAL studio Chart Plugins - Christians Software aus Nickenich