home *** CD-ROM | disk | FTP | other *** search
- /* ==( bench/rngflt.c )== */
-
- /* ----------------------------------------------- */
- /* Pro-C Copyright (C) 1988 - 1990 Vestronix Inc. */
- /* Modification to this source is not supported */
- /* by Vestronix Inc. */
- /* All Rights Reserved */
- /* ----------------------------------------------- */
- /* Written Nig 1-Jan-87 */
- /* Modified Geo 11-Dec-89 See comments below */
- /* ----------------------------------------------- */
- /* %W% (%H% %T%) */
-
- /*
- * Modifications
- *
- * 11-Dec-89 Geo - V2 version
- * 25-Oct-89 Geo - 1.32 Merge
- */
-
- /*
- * This routine will get the hi and lo values for range checks in
- * a generated program
- */
- # include <stdio.h>
- # include <bench.h>
- # include <field.h>
-
- static char low_mask[] = "z9";
-
- static FIELD f_low =
- {
- 2, 9, 1, NULL, low_mask,
- 0, 2, F_NUMERIC, REVVID, REVVID, CONFIRM_NEEDED | NO_BLANK,
- NULL, text_input, NULL, NULL
- };
-
- static char hi_mask[] = "z9";
-
- static FIELD f_hi =
- {
- 4, 9, 1, NULL, hi_mask,
- 0, 2, F_NUMERIC, REVVID, REVVID, CONFIRM_NEEDED | NO_BLANK,
- NULL, text_input, NULL, NULL
- };
-
- void range_flt(width, hlp, lo, hi, mask, ich)
- int width, hlp;
- float *lo, *hi;
- int *ich;
- char *mask;
- {
- char tmp[256];
-
- create_w(11, 30, 5, width+10);
- border_w(boxset, BOLD);
-
- disp_w(2, 2, NORMAL, "FROM :");
- disp_w(4, 2, NORMAL, " TO :");
-
- f_low.fmask = f_hi.fmask = mask;
- f_low.fbuff = f_hi.fbuff = tmp;
- f_low.fhelp = f_hi.fhelp = hlp;
- f_low.fieldlen = f_hi.fieldlen = width;
- tmp[width] = '\0';
- f_to_a(f_low.fbuff, (double)*lo, strlen(mask));
-
- *ich = 1;
- if ( input_wx(&f_low, K_ESC, K_DOWN, 0) != K_ESC )
- {
- *lo = (float) atof(f_low.fbuff);
- f_to_a(f_hi.fbuff, (double)*hi, strlen(mask));
- if( input_wx(&f_hi, K_ESC, K_DOWN, 0) != K_ESC )
- {
- *hi = (float) atof(f_hi.fbuff);
- *ich = 0;
- }
- }
- delete_w();
- }
-
-