Hello to you,
I'm using vfp7 sp1
The big problem in vfp programming is How to makes the form's retain/remain in a memory ?
I meant that in general "visual programming language" like VB, DELPHI, POWERBUILDER, VISUALDBASE (that's all I'd tested), When loading a form and the form becomes remain in the memory.
But not in VFP, we must make a way to makes the form remain in the memory.
e.g We are opening 3 forms (FORM_A, FORM_B, FORM_C)
The simple as I know is :
PUBLIC FORM_A
DO FORM FORM_A NAME FORM_A LINKED NOSHOW
FORM_A.SHOW
Why ?
Because Just in this way I can access all the contains in form.
Let say, all I opened form is in MODELESS
As we know VFP is based on "multiple instance of form" that means, If we call the above code two times that we can have two form in our screen. not like in VB,DELPHI,POWERBUILDER.
so How to protect it ?
I usually do :
PUBLIC FORM_A
IF VARTYPE( FORM_A ) != "O" && Letter of O not Zero
DO FORM FORM_A NAME FORM_A LINKED NOSHOW
ENDIF
FORM_A.SHOW
I usually put this code in my menu click.
Based on my experience in VFP programming, I'd some sugestions :
- Never Deal with FORM'S DATAENVIRONMENT
- Set Every Form's DATASESSION TO PRIVATE
Based on above so in my form's LOAD always had this code :
SET DATE ITALIAN
SET ...
SET ...
USE .. IN 0 && Zero
USE .. IN 0 && Zero
From the above code you also can "FORM'S TALK" (Communication from One form to another form even VFP not have ability to passing the parameter)
BUT...
I NEVER RELEASE THE PUBLIC VARIABLE
Because I have no idea how makes it release in generic way.
I share this experience is because I wanna Is there another better way to keep the form's object refrence ?
How the VFP programmers do in this situations ?
Please Advice
Steven
I'm using vfp7 sp1
The big problem in vfp programming is How to makes the form's retain/remain in a memory ?
I meant that in general "visual programming language" like VB, DELPHI, POWERBUILDER, VISUALDBASE (that's all I'd tested), When loading a form and the form becomes remain in the memory.
But not in VFP, we must make a way to makes the form remain in the memory.
e.g We are opening 3 forms (FORM_A, FORM_B, FORM_C)
The simple as I know is :
PUBLIC FORM_A
DO FORM FORM_A NAME FORM_A LINKED NOSHOW
FORM_A.SHOW
Why ?
Because Just in this way I can access all the contains in form.
Let say, all I opened form is in MODELESS
As we know VFP is based on "multiple instance of form" that means, If we call the above code two times that we can have two form in our screen. not like in VB,DELPHI,POWERBUILDER.
so How to protect it ?
I usually do :
PUBLIC FORM_A
IF VARTYPE( FORM_A ) != "O" && Letter of O not Zero
DO FORM FORM_A NAME FORM_A LINKED NOSHOW
ENDIF
FORM_A.SHOW
I usually put this code in my menu click.
Based on my experience in VFP programming, I'd some sugestions :
- Never Deal with FORM'S DATAENVIRONMENT
- Set Every Form's DATASESSION TO PRIVATE
Based on above so in my form's LOAD always had this code :
SET DATE ITALIAN
SET ...
SET ...
USE .. IN 0 && Zero
USE .. IN 0 && Zero
From the above code you also can "FORM'S TALK" (Communication from One form to another form even VFP not have ability to passing the parameter)
BUT...
I NEVER RELEASE THE PUBLIC VARIABLE
Because I have no idea how makes it release in generic way.
I share this experience is because I wanna Is there another better way to keep the form's object refrence ?
How the VFP programmers do in this situations ?
Please Advice
Steven