home *** CD-ROM | disk | FTP | other *** search
- #include <sybfront.h>
- #include <sybdb.h>
- #include <sybfrs.h>
-
- #if MSDOS
- # include "aforms.h"
- #endif /* MSDOS */
-
- /*
- ** CLRFD - Clear the fields on the screen.
- **
- ** The user has pressed the "Clear" option: reset all the fields
- ** other than the date and operator login fields.
- */
-
- clrfd(context, argarray)
- FRSCONTEXT *context;
- POINTER argarray[];
- {
-
- FORM *salesform;
- FRSIO *io_cxt;
- OBJDSC objdsc;
- OBJDSC *curfld = &objdsc;
- OBJDSC *nextfld;
-
- /* Get the form and allocate an io_cxt */
- salesform = fscurform(context);
- io_cxt = fsioalloc(salesform);
-
- /* Set the store id field as the first field fsionxtfld will return,
- ** so that we skip the first two fields.
- */
- fsiosetfld(io_cxt, NULL,
- fsfgetfld(salesform, "storeid", -1, NULL, curfld));
-
- /* Step through each field, starting with storeid, and clear it
- ** by writing an empty string into it.
- */
- for (nextfld = fsionxtfld(io_cxt, FALSE);
- nextfld != NULL;
- nextfld = fsionxtfld(io_cxt, FALSE) )
- {
- /* Note the zero passed for the string length. */
- fsfputval(salesform, nextfld, -1, SSOFF, NULL, "", 0, FALSE);
- }
-
- fsiofree(io_cxt);
- return;
- }
-