Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to update memory variable ?
Message
De
12/06/2002 15:09:53
 
 
À
12/06/2002 14:45:41
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00667421
Message ID:
00667589
Vues:
24
Somehow the variable frmMain is out of scope. When you started the form did you use the syntax:

DO frmMain NAME frmMain

?
Also, when you created the three form properties, don't bind them to anything. Just give them an initial value like .t., .f., "", etc depending on the value type. Bind the three controls (textboxes?) on the top level form to the three appropriate form properties such as text1.controlsource = thisform.currentquater or something similar.

I just tested it with a test form in code only and it works. Try this:
PRIVATE FrmMain
frmMain = CREATEOBJECT("myform")
frmMain.show()
*DO form FrmMain NAME FrmMain
MESSAGEBOX('Changing the value of text1 to Jones',0)
m.name="Jones"
frmMain.oname=m.name
FrmMain.text1.refresh()
MESSAGEBOX('Changing the value of text1 to Smith',0)
m.name="Smith"
frmMain.oname=m.name
FrmMain.text1.refresh()
MESSAGEBOX('click to Exit',0)
FrmMain.release()
RELEASE frmMain
REturn

DEFINE CLASS myform AS form


	DoCreate = .T.
	Caption = "Test Form"
	oname = ""
	Name = "Form1"


	ADD OBJECT text1 AS textbox WITH ;
		ControlSource = "thisform.oname", ;
		Height = 23, ;
		Left = 48, ;
		Top = 36, ;
		Width = 100, ;
		Name = "Text1"


ENDDEFINE
Tracy

>thanks tracy for replying
>
>but i get a error message 'object frmMain is not found'.
>
>ok here's what i did
>in my toplevel form i created three properties and bound to memory variables.
>
>in my prg i update the memory variables and before returning i issue
>
>frmMain.currentquater=m.mvQuarter_Q
>frmMain.year=m.mvQuarter_Y
>frmMain.masterupd=m.mvMasterUpd
>
>but the above error message popup now
>
>what's missing ?
>txs
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform