The following code was generated by

  1. Dragging a table from the Navigator table’s page onto the Form design surface

Here is the code:

** END HEADER -- do not remove this line

*

* Generated on 08/24/02

*

parameter bModal

local f

f = new UntitledForm( )

if (bModal)

f.mdi = .F. && ensure not MDI 

f.ReadModal( ) 

else

f.Open( ) 

endif

CLASS AnatomyForm OF FORM

this.Height = 12 

this.Left = 30 

this.Top = 0 

this.Width = 40 

this.Text = "" 

this.animals1 = new Query( ) 

this.animals1.parent = this 

with (this.animals1) 

Left = 10 

Top = 4 

SQL = 'SELECT * FROM "C:\PROGRAM FILES\dBASE\Plus\Samples\Animals.dbf"' 

Active = True 

endwith 

this.pushbutton1 = new pushbutton(this) 

with (this.pushbutton1) 

onClick = class::PUSHBUTTON1_ONCLICK 

Height = 1.1176 

Left = 20 

Top = 3 

Width = 15.875 

Text = "PUSHBUTTON1" 

Metric = 0 

FontBold = False 

Group = True 

endwith 

this.Rowset = this.animals1.Rowset 

// {Linked Method} Form.pushbutton1.onClick 

function PUSHBUTTON1_onClick 

this.text = form.rowset.count( ) 

ENDCLASS

There are four major sections in a .WFM file:

  1. The first part is the optional Header section. This is any code above the ** END HEADER line. Comments that describe the file are usually put here.

If you DO the .WFM with no parameters, the form is opened with the open( ) method. The form is modeless.

If you DO the .WFM with the parameter True, the form is opened with the readModal( ) method. The form is modal. A modal form cannot be MDI, so the form’s MDI property is set to False first.