WORD FAR PASCAL Nav ( //called every 200 ms
HWND hWnd, //identifies the Nav window
WORD wMsg, //timer message resulting in this call
int nIDEvent, //id number of system timer which made the call
DWORD dwTimer //current system time
) {
StnPoll(); //check rough distance of stations
RxInput(); //scan receiver tuner inputs etc.
TxScan(); //get station signal strengths
//The NAV Rx which is currently switched to the NAV computer
struct RxData *r = *(*(Rx + 4) + Air.Sw);
struct TxData *t = r->t ; //dominant station currently being received
double et = ElapsedTime(); //elapsed time since last pass
if((int Sig = r->Sig) > 0) //if in range of nav station
HorzSteer(t, r, et); //do horizontal (roll) steering
//If it is an ILS or ILS/DME and it is within glideslope range
if(((int st = t->StnType) == 4 || st == 5) && (Sig > 85))
VertSteer(t, r, et); //do vertical (pitch) steering
}
For this to work you will have to set up the timer in the WM_CREATE case in the application's MainWndProc() as follows:


