LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I reset the min value in a numeric control to -Inf

   SetCtrlVal(panel, PANEL_NUMERIC, 123.45);
   
   SetCtrlAttribute(panel, PANEL_NUMERIC, ATTR_MAX_VALUE, DBL_MAX);
   SetCtrlAttribute(panel, PANEL_NUMERIC, ATTR_MIN_VALUE, -DBL_MAX);
   
   GetCtrlVal(panel, PANEL_NUMERIC, &doub);
   
   fprintf (stderr, "value: %f\n", doub);
0 Kudos
Message 11 of 13
(1,101 Views)
my apolgies to all, for some reason my computer just seemed to go haywire & post multiple replies at once.  Sorry......
0 Kudos
Message 12 of 13
(1,101 Views)
Constants (as opposed to functions) are available in C99 for several values, including FP_INFINITE, FP_NAN, etc.

But, NI doesn't provice a C99 compliant compiler, rather it's a C89 compiler.

A related issue is that in C89 you must use a constant as an intializer.  In C99 you could use a function to initialize a value to, say infinity, but then you wouldn't have to because you could use the constant 😉

This problem keeps coming up.  There are several troublesome areas cleaned up in C99.  I think NI should release a C99 compliant compiler for CVI.

Hayes
0 Kudos
Message 13 of 13
(1,068 Views)