Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Memory variable
Message
From
28/03/2005 04:23:51
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
28/03/2005 00:57:03
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00999363
Message ID:
00999375
Views:
13
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform