Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Losing Focus
Message
 
To
10/11/2001 09:02:21
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00580131
Message ID:
00580147
Views:
19
Steve,

First public variables area bad idea anywhere.

Add a property to your fomr named mfSheets then use this code in the form's Init;
* Form Init
LParameter tnmfSheets
This.mfSheets = tnmfSheets
Then whenreever within your form code that you need the value use Thisform.mfSheets

In addition, if you are getting a type problem, you may want to insure the datatype of the parameter as in;
* Form Init
LParameter tnmfSheets
IF TYPE("tnmfSheets") <> "N"
   * Not a numeric datatype
   * Do what ever you need to do for the bad data type
ENDIF
This.mfSheets = tnmfSheets
>I am senting a numeric value to a form parameter. I then make a public variable and assing thia parameter to it. I then use this variable in a programatic change event in a text box as part of a calculation. I send a ref to this text box to a program to do a process which sends a value back to the textbox. Somewhere the original variable looses focus because I get an error that function value or argument type is invalid.
>
>Parameter mfsheets
>Public mfsheets1
>mfsheets1 = mfsheets
>
>>TextBox ProgramicChangeEvent
>Local vresl
>vresl = 0
>vresl = ((Val(This.Value)/mfsheets1)*100)
>ThisForm.Label1.Caption = Str(vresl) + "% Complete"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform