
PRIVATE hNew AS Fsecond STATIC PUBLIC SUB Main() DIM hForm AS Form hForm = NEW Fmain hForm.show END PUBLIC SUB Button1_Click()'if the second parameter is true, the new window should be modal
ShowSecond("modal, " & TextBox1.Text, TRUE)
END
PUBLIC SUB Button2_Click()
ShowSecond("modeless, " & TextBox1.Text, FALSE)
END
PRIVATE SUB ShowSecond(strVal AS String, bmode AS Boolean)
IF bmode THEN
'here the constructor of the class Fsecond is used
hNew = NEW Fsecond(strVAl)
hNew.ShowModal
ELSE
'here a method of Fsecond is used to receive the
hNew = NEW Fsecond
hNew.UpdateField(strVal)
hNew.Show
ENDIF
END
'the parameter has to be optional,
'otherwise it would be impossible to
'initialize an instance of this class
'without a parameter
PUBLIC SUB _new(OPTIONAL X AS String) UpdateField(X) END PUBLIC SUB UpdateField(wort AS String) TextLabel1.Text=wort END