If you are wanting to simply calculate a weight and display it in a form, then use the INIT method to calculate the weight and assign to the display object. Also, I assume you would want to pass some parameters to the form in order to offer different calculations.
PROCEDURE Init
LPARAMETERS pnUseSize, pnBlunt
IF VARTYPE(pnUseSize) != "N" .OR. VARTYPE(pnBlunt) != 'N'
WAIT WINDOW "Invalid parameters for weight calculation"
RETURN .F.
ELSE
<
>.CalcWeight.value = pnUseSize * pnUseSize * pnBlunt * 0.222
ENDIF
ENDPROC
Note that the value above, <>, must be the parent of the CalcWeight object. If the CalcWeight object is located directly onto a form, then use "thisform" for <> (no quotes); if the CalcWeight object is located, say on a pageframe, page1, then use "thisform.pageframe1.page1" for <> (again no quotes).
The above example is called by:
lnUseSize = 10.0 && This is set by whatever algorithim in your code
lnBlunt = 9.0 && This is set by whatever algorithim in your code
DO FORM MyFormName WITH lnUseSize, lnBlunt
I am testing that numeric values were passed to the form; if not, then the form will exit without displaying (caused by the RETURN .F. statement).
Hope this helps.