home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QBasic & Borland Pascal & C
/
Delphi5.iso
/
C
/
Samples
/
CSAPE32.ARJ
/
SOURCE
/
CSSRC
/
SD1STFLD.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-03-28
|
1KB
|
61 lines
/*
sd1stfld.c 11/10/86
% sed_GotoFirstField
C-scape 3.2
Copyright (c) 1986, 1987, by Oakland Group, Inc.
ALL RIGHTS RESERVED.
Revision History:
-----------------
11/18/87 jmd changed names of some low-level funcs
4/08/88 jmd changed sed->fieldcount to sed_GetFieldCount()
3/24/89 jmd added sed_ macros
3/17/90 jmd added Cache/Flush
3/28/90 jmd ansi-fied
*/
#include "sed.h"
int sed_GotoFirstField(sed_type sed)
/*
modifies: sed object.
effects: tries to go to the first unprotected editing field
(contingent upon passing the fexit test).
If the sed is active, call the fenter and fexit functions.
*/
{
register int first_fld;
cs_Assert(sed_Ok(sed), CS_SD_GFF_SED, 0);
/* find next unprotected field */
for (first_fld = 0; first_fld < sed_GetFieldCount(sed); first_fld++) {
if (!menu_IsProtected(sed_GetMenu(sed), first_fld))
break;
}
if (first_fld >= sed_GetFieldCount(sed)) { /* no unprotected fields found */
return(SED_STUCK);
}
if (!sd_exitfield(sed)) {
return(SED_INVALID);
}
disp_Cache();
sd_scroll_adjust(sed, first_fld);
sd_goto_field(sed, first_fld);
if (sed_IsActive(sed)) {
sed_DoFieldFenter(sed, sed_GetFieldNo(sed));
}
disp_Flush();
return(SED_MOVED);
}