>Add in the Init of the form after Thisform.AddObject('ctbox1','TBOXyes')
>Thisform.cbox1.value = mgooddate
This seems to have no effect unfortunately. unless I quit vfp or do a "clear all", the same value still keeps appearing.
>
>>>My advise would be not to use .MEM files. Store data in the table, INI file or registry, whatever is better for you.
>>Sergey I just converted it to a table and I get the same results. Prob lies in my "value = mgooddate" statement, I think but can't figure it out
>>
>>>
>>>
>>>>I have designed a form programatically as in the example vfp gives in the addobject help section. This is most of the prg I have. Problem is after I enter a new value, it gets saved to the mem variable ok but when I run the prg immediately afterward, the old value keeps appearing in the textbox.
>>>>
>>>
>frmMyForm.AddObject('ctbox1','TBOXyes')
>>>>restore from l:gooddate.mem addit
>>>>DEFINE CLASS tboxyes AS textbox
>>>> value = mgooddate
>>>> Left = 50
>>>> Top = 100
>>>> Height = 25
>>>> width=49
>>>> inputmask='99999'
>>>>
>>>>PROCEDURE keypress
>>>> para nkeycode,hello
>>>> if nkeycode=13
>>>> mgooddate=allt(thisform.cmdCmndBtn1.value)
>>>> save all like mgooddate to l:gooddate
>>>> releas cmdyes,cmdCmndBtn1
>>>> release mgooddate
>>>>rest from l:gooddate.mem addit
>>>> CLEAR EVENTS
>>>> release thisform
>>>>endi
>>>>ENDDEFINE
"Build a man a fire, and he's warm for a day.
Set a man on fire, and he's warm for the rest of his life."