hi
i am having an experiment with sensors. I calcualte the current distance top be d0 & print it out. But i need to get a reference point
So i want to set a reference point everytime i press a key& the distance then has to be caluculated
with "dref - do" .... & this " new" current distance has to be given out.Does anyone have ideas for the syntax !
thanks

Code:
case WM_PAINT:

...

...

d0 = s[1].d + (z_[0] * ( s[2].d - s[1].d )) + (z_[1] * ( s[3].d - s[1].d )) + (z_[2] * ( s[4].d - s[1].d ) )+ (z_[3] * ( s[5].d - s[1].d ));




y += CharHeight*2; /* Print */
sprintf (OutString,"d current = %lf ", d0);
TextOut(hDC, x, y, OutString, strlen (OutString));





SetTextAlign(hDC, TA_LEFT | TA_TOP);
EndPaint(hWndMain, &ps);
break;


case WM_KEYDOWN:

if (wParam == 'A') {


}