>If I declare a variable in init event of a form
>this variable is not found in a button or other object of the form
>
>I have to declare it as public
>
>Is it really necessary to declare the variable as public ?
Yes (if you want to use VARIABLE). The variable is scoped to current code portion if it is not declared as PUBLIC (Grrrrr).
If you want something which is accessible in all form methods and events better use form property:
thisform.AddProperty([property name here], property value here)
But you should reference that property (when you need it) no only with its name but with thisform. infront of it:
thisform.AddProperty([MyProperty], -777)
LOCAL lntest
lntest = 123123/thisform.MyProperty*3.14
WAIT WINDOW lntest
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.