
14 Appendix A1 Extending Ox
symbol defines it as having three constant arguments. The implementation is
listed below.
• OxMain compiles the code and returns a value > 1 when successful. That value
is stored in iMainIP and used in subsequent calls to specific Ox functions.
• When RanApp is run, and ranapp.ox compiled successfully, the Generate but-
ton lights up. Then, when Generate is pressed, the OnGenerate function from
ranapp.ox (given below) is called, and the Draw and Variance buttons become
active. These buttons also lead to a call to underlying Ox code. The C
++
calls
are:
....................................ox/dev/windows/ranapp/RanAppDlg.c (part of)
static BOOL callOxFunction(char *sFunction)
{
BOOL ret_val = FALSE;
TRY
{
FOxRun(g_iMainIP, sFunction);
ret_val = TRUE;
}
CATCH_ALL(e)
{
}
END_CATCH_ALL
return ret_val;
}
void CRanAppDlg::OnDimension()
{
callOxFunction("OnDimension");
}
void CRanAppDlg::OnGenerate()
{
m_variance.EnableWindow();
m_draw.EnableWindow();
callOxFunction("OnGenerate");
}
void CRanAppDlg::OnDraw()
{
callOxFunction("OnDraw");
}
void CRanAppDlg::OnVariance()
{
callOxFunction("OnVariance");
}
.......................................................................................
Below is a listing of ranapp.ox, the program behind this application. It is a simple
Ox program which draws random numbers in OnGenerate, prints their variance matrix
in OnVariance, and draws the correlogram and spectrum in OnDraw.
Commentaires sur ces manuels