>>PUBLIC oform1 >>SET CENTURY ON >>oform1=NEWOBJECT("myform") >>oform1.Show >>RETURN >> >>DEFINE CLASS myform AS form >> Top = 16 >> Left = 62 >> Height = 250 >> Width = 282 >> DoCreate = .T. >> Caption = "Form" >> ox = .F. >> >> ADD OBJECT text1 AS textbox WITH ; >> Alignment = 3, ; >> Height = 23, ; >> Left = 104, ; >> TabIndex = 1, ; >> Top = 28, ; >> Width = 103, ; >> Name = "Text1" >> >> ADD OBJECT label1 AS label WITH ; >> Alignment = 1, ; >> Caption = "FROM:", ; >> Height = 19, ; >> Left = 40, ; >> Top = 30, ; >> Width = 49, ; >> TabIndex = 4, ; >> Name = "Label1" >> >> ADD OBJECT label2 AS label WITH ; >> Alignment = 1, ; >> Caption = "TO:", ; >> Height = 19, ; >> Left = 40, ; >> Top = 68, ; >> Width = 49, ; >> TabIndex = 5, ; >> Name = "Label2" >> >> ADD OBJECT text2 AS textbox WITH ; >> Alignment = 3, ; >> Height = 23, ; >> Left = 104, ; >> TabIndex = 2, ; >> Top = 68, ; >> Width = 103, ; >> Name = "Text2" >> >> ADD OBJECT command1 AS commandbutton WITH ; >> Top = 183, ; >> Left = 97, ; >> Height = 38, ; >> Width = 110, ; >> Caption = "START", ; >> TabIndex = 3, ; >> Name = "Command1" >> >> ADD OBJECT year AS textbox WITH ; >> Enabled = .F., ; >> Height = 23, ; >> Left = 57, ; >> TabIndex = 6, ; >> Top = 130, ; >> Width = 53, ; >> Name = "Year" >> >> ADD OBJECT month AS textbox WITH ; >> Enabled = .F., ; >> Height = 23, ; >> Left = 123, ; >> TabIndex = 7, ; >> Top = 130, ; >> Width = 53, ; >> Name = "month" >> >> ADD OBJECT day AS textbox WITH ; >> Enabled = .F., ; >> Height = 23, ; >> Left = 186, ; >> TabIndex = 8, ; >> Top = 130, ; >> Width = 53, ; >> Name = "day" >> >> ADD OBJECT label3 AS label WITH ; >> Caption = "Year", ; >> Height = 17, ; >> Left = 57, ; >> Top = 102, ; >> Width = 47, ; >> TabIndex = 9, ; >> Name = "Label3" >> >> ADD OBJECT label4 AS label WITH ; >> Caption = "Month", ; >> Height = 17, ; >> Left = 125, ; >> Top = 102, ; >> Width = 47, ; >> TabIndex = 10, ; >> Name = "Label4" >> >> ADD OBJECT label5 AS label WITH ; >> Caption = "Day", ; >> Height = 17, ; >> Left = 190, ; >> Top = 102, ; >> Width = 47, ; >> TabIndex = 11, ; >> Name = "Label5" >> >> PROCEDURE Init >> ThisForm.ox = NEWOBJECT( "AgeCalculator", "age.vcx") >> ThisForm.Text1.Value = DATE(1956,09,23) >> ThisForm.Text2.Value = DATE() >> ENDPROC >> >> PROCEDURE command1.Click >> ThisForm.ox.CalculateAge( ThisForm.Text1.Value,ThisForm.Text2.Value) >> ThisForm.Year.Value = ThisForm.ox.nYears >> ThisForm.Month.Value = ThisForm.ox.nMonths >> ThisForm.Day.Value = ThisForm.ox.nDays >> ENDPROC >>ENDDEFINE >>