Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Input Date in the TextBox
Message
 
To
28/06/2001 06:05:53
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00524522
Message ID:
00524580
Views:
15
Cetin
You're right about adding the properties to the form, instead of using public. OTOH, sometimes i'm lazy, and i define all the memvars as public in the init, and release them in the unload method. This way, i can load the data with scatter and save with gather, instead of writing all the Replace commands.

>>Thanks a lot for your prompt reply. Unfortunately, I am still confused.
>>Let me explain the problem in details.
>>
>>I have a textbox in which I want the user to input date. text1.format is "E". By default century is ON. I am not chenging it anywhere. I have not changed form.datasession also. It is also set to default only. text1.controlsource is m_Fr_dt. in form.init I have following statment - STORE {} TO m_Fr_Dt.
>>
>>The form is open in modify mode. I am trying to test the form. When I run the form for the first time (by clicking on "!" icon) and enter any date in this textbox, the year does not change to 4 digit year. At the same time, if I issue a command - WAIT DTOC(m_Fr_Dt) WINDOW anywhere else in the form, it generates the error - Function argument value, tpe, or count is invalid.
>>
>>Surprisingly, when I run the form second time, everything works just fine. And I don't know how and why ???
>
>Oh memvar as controlsource. OK still try setting its value property to {}.
>Store {} to m_FR_dt
>in form.init is goen with the wind. Unlike fox2x style in VFP once a method/event code ends all variables that are not public goes out of scope (I don't mean use public). To preserve variables rather use properties. ie: add a property to form called m_Fr_dt. All form objects can see thisform.m_Fr_dt
>
>PS: You don't need to set controlsource to a memvar. Instead leave it empty and when needed (assuming textbox named myTextbox_FR_Dt) :
>
>something = thisform.myTextbox_FR_dt.value
>wait window dtoc(thisform.myTextbox_FR_dt.value)
>
>Cetin
Why do programs stop working correctly as soon as you leave the Fox?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform