Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Jamie Osborn
  Where is Jamie Osborn?
 Melbourne
 Australia
 Jamie Osborn
 To: Leif Rickegard
  Where is Leif Rickegard?
 Stockholm
 Sweden
 Leif Rickegard
 Tags
Subject: RE: How to use private and declare a variable i...
Thread ID: 16299 Message ID: 16366 # Views: 1 # Ratings: 0
Version: Unknown Category: General VFP Topics
Date: Thursday, October 17, 2002 8:31:36 AM         
   


> Thanks for the answer, but i don't get it too work.
>
> I use the variable m.main for some bottoms-code like:
>
> skip in (m.main)
>
> or
>
> go top in (m.main)
>
> Hove to solv this?
>
> Thanks
>
> > Add property 'main' in the form init event, like
> > thisform.addproperty("main","customer")
> >
> > Then you will be able to call this as variable everywhere in the form, like:
> > thisfrom.main="customer2"
> >
> > Regards
> >
> >
> > > I try to use a variable in all forms named m.main telling what table is the leading table in every form. I try to put this in INIT EVENT of the form:
> > >
> > > Private main
> > > m.main="customer"
> > >
> > > But when i try to use m.main in the program i get a error "Variable 'main' is not found."
> > >
> > > How do i get the m.main to be accessed i the hole form?
> > >
> > > Leri
>
>
> Leri

Yuri's code will work - you just refer to thisform.main
eg. SKIP IN (thisform.main)
Better than having a global variable for every form !!!!

If the form is calling code that needs to know the property value then pass an object reference to the form
eg.
From the form :
lResult = MyProc(thisform)

In MyProc.Prg :
LPARAMETERS toForm

SKIP IN (toForm.main)


Cheers,
Jamie
jamie.osborn@foxite.com

ENTIRE THREAD

How to use private and declare a variable in forms Posted by Leif Rickegard @ 10/16/2002 10:42:35 AM
RE: How to use private and declare a variable i... Posted by Yuri Rubinov @ 10/16/2002 2:37:16 PM
RE: How to use private and declare a variable i... Posted by Leif Rickegard @ 10/16/2002 3:37:49 PM
RE: How to use private and declare a variable i... Posted by Yuri Rubinov @ 10/16/2002 3:54:47 PM
RE: How to use private and declare a variable i... Posted by Leif Rickegard @ 10/16/2002 7:57:03 PM
RE: Remember to release the public variable Posted by Vyas Kumar R @ 10/17/2002 6:28:31 AM
RE: How to use private and declare a variable i... Posted by Jamie Osborn @ 10/17/2002 8:31:36 AM
RE: How to use private and declare a variable i... Posted by Khalil Shaddad @ 10/18/2002 10:12:05 AM