I would have thought if an invalid value was entered, the InputBox should at least return a value of 1 (cancel) so it's aware the value supplied might be wrong?
The code I was using to test this was -
Code: Select all
#include "KMotionDef.h"
#define TMP 10 // which spare persist to use to transfer data
#include "KFLOPToKMotionCNCFunctions.c"
float inputResult;
void main()
{
//DoPCFloat(PC_COMM_SET_X,1);
printf("Running...\n");
int Answer = InputBox("Enter a number",&inputResult);
printf("Answer:%d\n",Answer);
if (Answer){
printf("Operator Canceled\n");
} else {
printf("Operator Entered Value of %.3f\n",inputResult);
}
}