home *** CD-ROM | disk | FTP | other *** search
- /*
- fnstdval.c 8/07/89
-
- % std_NumValid
-
- Standard numeric validation routine.
-
- C-scape 3.1
- Copyright (c) 1989, by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- By using these routines duplicate code is eliminated, shrinking code
- size.
-
- Revision History:
- -----------------
- */
-
- #include <stdio.h>
-
- #include "cscape.h"
-
- boolean std_NumValid(sed, val)
- sed_type sed;
- double val;
- /*
- Standard numeric validation routine for numeric field fexit functions.
-
- Validates the field record using the information in the
- field's second data pointer. If invalid it beeps, flashes
- a message and waits for a keystroke.
-
- It also calls the field's sexit and senter functions to make sure
- that what the user sees is exactly what is stored in the variable.
-
- Combining all the separate fexit routines saves on code size.
- */
- {
- if ( !valid_Double(val, (char *) sed_GetCurrFieldData(sed, 1)) ) {
- tone();
- sed_BorderPrompt(sed, fnnum_errmsg);
-
- /* wait for a keystroke */
- while (!kb_Check()) {
- ;
- }
-
- sed_BorderPrompt(sed, sed_GetCurrFieldData(sed, 0));
- return(FALSE);
- }
-
- sed_DoFieldSexit(sed, sed_GetFieldNo(sed));
- sed_DoFieldSenter(sed, sed_GetFieldNo(sed));
- sed_UpdateCurrField(sed);
-
- return(TRUE);
- }
-