Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Global variable
Message
From
22/05/2002 12:15:59
 
 
To
22/05/2002 12:01:06
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00659966
Message ID:
00659974
Views:
22
Welcome to the UT.

Public variables should generally be avoided. If you need a variable to be visible throughout a form, you can add a property to the form. For example, if you name the property 'myProperty', you can refer to it anywhere in the form as thisform.myProperty.

Also, if you create a variable in your main startup program, it is considered "PRIVATE" by default. This means it is visible to all programs/forms below that level. In essence, this kind of variable is global as far as your application is concerned. But again, they should be used sparingly to hold objects such as an application object.

The books at www.hentzenwerke.com are excellent; you probably should start with the Fundamentals book (although I have not read that one). The Essentials, Hacker's Guide, and 1000 Things books are all worthwhile purchases.

>Hi all,
>
>I am a new learner in Visual Foxpro. Now try to use it to develop some project for myself. I am quite familiar with VB and assume that the programming in visual foxpro should be quite similiar but somehow i am wrong.
>
>I try to assign a global variable but never able to do so. When i type in "Global try_variable" under init in main form, it keep saying unrecognized command verb. I try to search through my foxpro book but no example of global variable assignment.
>
>Any one can tell me how i should do it ? and what good reference book i can get for Visual foxpro (I using version 6)
>
>Thank you and best regard
Steve Gibson
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform