Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forms and "= CURSORSETPROP"

Status
Not open for further replies.

Maxlore

IS-IT--Management
Mar 9, 2011
12
US
OK I have a couple of questions..Where should I place the
= CURSORSETPROP('Buffering', 3, 'customer') in the main.prg
or should i place it in the forms init event, or the load event,
and can I set it for all my tables at one time instead issuing
for each table??

Next I have several forms (not in a form set), I call form1 which
depending on the user selections i then call form2 which is no problem,,but when i do form3 i pass variables from form2 properties to form3 with the DO FORM WITH parms..For some unknown reason to me the properties are being reset to the initial value..

In form2 init method i have

PARAMETERS oNewCust,oCustEdit,oTrecno

DO CASE
CASE oNewCust = .T.
"whatever need to be done"
CASE oCustEdit = .T.
"whatever need to be done"
CASE oTrecno = .T.
"whatever need to be done"
ENDCASE


Next i have a command button that comes on depending on the case
statement and options the user has selected ..Still no problem yet...

Here is where the problem comes in..

In the command button i call form3 passing parameters oNewCust,oCustEdit,oTrecno

DO FORM formname WITH oNewCust,oCustEdit,oTrecno

ALL of these properties is being reset to .F. or a value not assigned.. I have checked in debug and as soon as i issue the
DO FORM the parms are reset..I do not understand...Maybe this
is very sloppy or not the right way at all..Please advise me,
I am trying to get a understanding of vfp...


 
Sorry guys i am using a IF statement not a DO CASE,,Copied and pasted the wrong thing...
 
Generally, you should start a thread for each question rather than piling them all up in one post where people might not see them.

You should set buffering exactly where it needs to be set. Many of us set it in the form's dataenvironment object and leave it at that. But there is no global setting. It needs to be set (and un-set) for each workarea in each datasession.

For your parameters problem, I'm willing to bet you're not storing them in a form property so at the end of the init method they go out of scope and are released.
 
Maxlore,

Regarding the location of your CURSORSETPROP(). This must done after you open the tables.

Assuming your form has a private data session, you will be opening the tables either in the Load of the form, or via the data environment. If you are using the Load, then the CURSORSETPROP() should also go in the Load. If you are using the data environment, you can either put it in the Load, or alternatively enable buffering by setting the form's BufferMode property to 1 or 2.

I also agree with Dan about not using the same thread for muliple unrelated questions.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
ok thank you guys .. i know better now..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top