Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Bebot Chan
  Where is Bebot Chan?
 Saudi Arabia
 Bebot Chan
 To: Ken Murphy
  Where is Ken Murphy?
 Ken Murphy
Subject: RE: RUNTYPE Variable
Thread ID: 78958 Message ID: 78965 # Views: 1 # Ratings: 0
Version: Visual FoxPro 8 Category: General VFP Topics
Date: Tuesday, October 11, 2005 4:18:00 PM         

> > Sorry for this, it turns out that it was actually a field in another table that was open which overwrote my memvar. Thanks for the reply.
> >
> > > > Is "RUNTYPE" a reserved name or a system variable in VFP? I declared it as LOCAL and it was giving weird results. I then changed it to another variable name and everything went fine. It is not a field in my table nor has it been declared PUBLIC anywhere outside the program.
> > >
> > > What kind of "weird results" are we talking about? Can you show some code?
> > > --
> > > Eric den Doop
> > > www.foxite.com - The Home Of The Visual FoxPro Experts

> Bebot,
> If you declare this variable as LOCAL, you should probably prefix the variable with 'l'. For example a local character variable named "RunType" should be prefixed with 'l' for local and 'c' for character. You would then be able to tell the type and scope of a variable strictly by the name. For example, lcRunType is a local character variable. gnRunType is global, numeric variable. The added benefit to using this naming convention is that you can use any variable name - even reserved words. You could even create a varible lcUSE to hold a table name variable. You would also avoid conflict with table fields as these field names are prefixed with the table name and a period.
> Ken

Thanks Ken. I come from the old environment when Hungarian notation was a virtual unknown. I have not yet joined the bandwagon but I do use the "m." prefex to name my memvars on large programs to avoid conflict with field names. I normally use descriptive memvars on small and manageable prgs, force of habit maybe. You're right, I should be looking for ways to prevent conflicts, like prefixing field names with table names. Thanks again.


RUNTYPE Variable Posted by Bebot Chan @ 10/11/2005 3:13:44 PM
RE: RUNTYPE Variable Posted by Eric den Doop @ 10/11/2005 3:17:08 PM
RE: RUNTYPE Variable Posted by Bebot Chan @ 10/11/2005 3:36:54 PM
RE: RUNTYPE Variable Posted by Ken Murphy @ 10/11/2005 4:04:21 PM
RE: RUNTYPE Variable Posted by Bebot Chan @ 10/11/2005 4:18:00 PM