home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QBasic & Borland Pascal & C
/
Delphi5.iso
/
C
/
Samples
/
CSAPE32.ARJ
/
SOURCE
/
FUNCS
/
FNSTDVAL.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-09-11
|
1KB
|
55 lines
/*
fnstdval.c 8/07/89
% std_NumValid
Standard numeric validation routine.
C-scape 3.2
Copyright (c) 1989, by Oakland Group, Inc.
ALL RIGHTS RESERVED.
By using these routines duplicate code is eliminated, shrinking code
size.
Revision History:
-----------------
1/25/90 jmd converted kb_Check to kb_CheckWait
3/16/90 jmd added support for KEY_INVALID
3/28/90 jmd ansi-fied
9/07/90 jmd ifdef'd out code that call sexit/senter
9/11/90 pmcm changed sed_SetMouseCode to kb_Stuff
*/
#include <stdio.h>
#include "cscape.h"
#include "scancode.h"
boolean std_NumValid(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)) ) {
/* Invalid entry: notify fkey function via mouse code */
kb_Stuff(KEY_INVALID);
return(FALSE);
}
#ifdef DOSEXIT
sed_DoFieldSexit(sed, sed_GetFieldNo(sed));
sed_DoFieldSenter(sed, sed_GetFieldNo(sed));
sed_UpdateCurrField(sed);
#endif
return(TRUE);
}