Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: onytoo
  Where is onytoo?
 Padang
 Indonesia
 onytoo
 To: Jun Tangunan
  Where is Jun Tangunan?
 Cabanatuan
 Philippines
 Jun Tangunan
 Tags
Subject: RE: Collection vs _Screen vs Public Variable
Thread ID: 289252 Message ID: 289346 # Views: 35 # Ratings: 0
Version: Visual FoxPro 9 Category: Classes and Objects
Date: Friday, December 31, 2010 4:14:51 AM         
   


> >
> > Yeah you right Mike.
> > The prefix is not merely as a prefix, but to further confirm what type of data we are working.
> >
> >
> > USE Company IN 0
> > LOCATE
> > SCATTER NAME oCompany
> > ? oCompany.Name
> > ? oCompany.Address
> > 
> > 

> >
> > Uh, a like this stuff...
> >
> >
> > Regards,
> > Onytoo
>
> Yeah, it is most of the times escaping my mind. I think I will be changing the contents of that blog so future readers will have the proper names. Also, would you mind if I add your EMPTY approach on the _screen onto that blog?
>
>
> http://www.junblogs.com/
> http://weblogs.foxite.com/sandstorm36/default.aspx
> http://www.coderisland.com/forum/viewforum.php?f=10

Actually, I also often use empty object as ControlSource to the controls on the form.

*!* method Init
thisform.AddProperty([oCompany], .NULL.)
thisform.AddProperty([cCompanyCursor], SYS(2015))
=SQLEXEC(thisform.nHandle, [SELECT ..], thisform.cCompanyCursor)

*!* method RecordMove
LPARAMETERS tcMove
SELECT (thisform.cCompanyCursor)
DO CASE
CASE tcMove == [FIRST]
  LOCATE
CASE tcMove == [PREV]
  IF !BOF()
    SKIP -1
  ENDIF
  IF BOF()
    LOCATE
  ENDIF
...
ENDCASE
SCATTER NAME thisform.oCompany MEMO
thisform.SetControlSource()

*!* method SetControlSource
thisform.txtCompanyName.ControlSource = [thisform.oCompany.Name]
thisform.txtCompanyAddress.ControlSource = [thisform.oCompany.Address]
..

*!* method Add
SELECT (thisform.cCompanyCursor)
SCATTER NAME thisform.oCompany MEMO BLANK
thisform.lAddMode = .T.

*!* method Save
SELECT (thisform.cCompanyCursor)
IF thisform.lAddMode
  APPEND BLANK
  thisform.lAddMode = .F.
ENDIF
GATHER NAME thisform.oCompany MEMO



Regards,
Onytoo

ENTIRE THREAD

Collection vs _Screen vs Public Variable Posted by Jun Tangunan @ 12/30/2010 2:46:28 AM
RE: Collection vs _Screen vs Public Variable Posted by Ony Too @ 12/30/2010 10:20:16 AM
RE: Collection vs _Screen vs Public Variable Posted by Jun Tangunan @ 12/30/2010 11:58:43 PM
RE: Collection vs _Screen vs Public Variable Posted by Mike Yearwood @ 12/31/2010 12:11:39 AM
RE: Collection vs _Screen vs Public Variable Posted by Jun Tangunan @ 12/31/2010 12:22:18 AM
RE: Collection vs _Screen vs Public Variable Posted by Ony Too @ 12/31/2010 12:29:58 AM
RE: Collection vs _Screen vs Public Variable Posted by Jun Tangunan @ 12/31/2010 12:39:56 AM
RE: Collection vs _Screen vs Public Variable Posted by Ony Too @ 12/31/2010 3:46:22 AM
RE: Collection vs _Screen vs Public Variable Posted by Jun Tangunan @ 12/31/2010 4:06:01 AM
RE: Collection vs _Screen vs Public Variable Posted by Ony Too @ 12/31/2010 4:14:51 AM