PROCEDURE cmdForm1.Click Thisform.AddProperty("lcRetVal", "Unknown") DO FORM FORM2 TO Thisform.lcRetVal WAIT WINDOW NOWAIT "Form 2 return value = "+lcRetVal>Sergey, thanks for the reply.
Create Form1.scx with... > Caption = "Form 1" > WindowType = 1 > >Place a button form1 with... > Caption = "Call form 2" > Name = "cmdForm1" > PROCEDURE cmdForm1.Click > LOCAL lcRetVal > > DO FORM FORM2 TO lcRetVal > > WAIT WINDOW NOWAIT "Form 2 return value = "+lcRetVal > ENDPROC > >Create Form2.scx with... > Caption = "Form 2" > WindowType = 1 > > PROCEDURE Unload > RETURN "The expected return value" > ENDPROC > > PROCEDURE Init > thisform.top = 30 && so as not to cover form1 > thisform.left = 30 > ENDPROC > >Place a button on form2 with... > Name = "cmdForm2" > Caption = "Close Form 2" > > PROCEDURE cmdForm2.Click > THISFORM.RELEASE > ENDPROC>Then run the toolbar sample code you sent me, but with 'DO FORM Form1' instead of 'DO FORM MyForm TO RetVal'. Press the button on form1 to call form2. Pressing the button on form2 closes the form and correctly displays the return value in the WAIT WINDOW, but closing form2 using the toolbar (either button) produces an error ('Operator type mismatch...') that suggests the value was not returned to the variable.