home *** CD-ROM | disk | FTP | other *** search
- /* ==( bench/rngsdate.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[] = "MM-DD-YY";
-
- static FIELD f_low =
- {
- 2, 9, 1, NULL, low_mask,
- 0, 2, F_DATE, REVVID, REVVID, CONFIRM_NEEDED | NO_BLANK,
- NULL, text_input, NULL, NULL
- };
-
- static char hi_mask[] = "MM-DD-YY";
-
- static FIELD f_hi =
- {
- 4, 9, 1, NULL, hi_mask,
- 0, 2, F_DATE, REVVID, REVVID, CONFIRM_NEEDED | NO_BLANK,
- NULL, text_input, NULL, NULL
- };
-
- void range_sdate(width, hlp, lo, hi, mask, ich)
- int width, hlp;
- char *lo, *hi;
- char *mask;
- int *ich;
- {
- 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';
- strcpy(f_low.fbuff, ltocon(dstrtol(lo, "MMDDYY"), f_low.fmask, 1));
-
- *ich = 1;
- if (input_wx(&f_low, K_ESC, K_DOWN, 0) != K_ESC)
- {
- strcpy(lo, ltocon(dstrtol(f_low.fbuff, "MMDDYY"), f_low.fmask, 1));
- strcpy(f_hi.fbuff, ltocon(dstrtol(hi, "MMDDYY"), f_hi.fmask, 1));
- if (input_wx(&f_hi, K_ESC, K_DOWN, 0) != K_ESC)
- {
- strcpy(hi, ltocon(dstrtol(f_hi.fbuff, "MMDDYY"), f_hi.fmask, 1));
- *ich = 0;
- }
- }
- delete_w();
- }
-
-