>Hi all !
>
>I have a cursor named "_Plan" it contains field named "TrxDate". And then i put commands at Form1.Load :
>
>SELECT _Plan
>SCATTER MEMVAR MEMO
>
>In Form1.load i can access the m.TrxDate variable, but i can't use it at another procedure such as "Command1.click" in the same Form.
>
>My question is : can i access the variable in another procedure without using PUBLIC Decrlaration ? In ancient Foxpro (Ver.2.6) memory variables are accessable in all procedure in the same screen without declaring public variable.
>
>Thanks a lot
>Winarto.
Winarto,
As soon as Load method finish m.trxDate goes out of scope. You can't access to that variable anymore (unless it's public and public is not suggested).
Create a custom property on your form, say oRecord. In form load then:
scatter name this.oRecord memo
Any method/event then could access it. ie: myButtonClick:
m.trxDateAtLoad = thisform.oRecord.trxDate
PS: Behavior is still like it was in Fox2x. Think of a method as a procedure you called (m.trxDate created in that procedure wouldn't be available upon return).
Cetin