home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QBasic & Borland Pascal & C
/
Delphi5.iso
/
C
/
Samples
/
CSAPE32.ARJ
/
SOURCE
/
CSSRC
/
SDDELFLD.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-03-28
|
945b
|
45 lines
/*
sddelfld.c 4/10/88
% sed_DeleteField
C-scape 3.2
Copyright (c) 1988, by Oakland Group, Inc.
ALL RIGHTS RESERVED.
Revision History:
-----------------
2/02/89 jdc added sed currfield = NULL when no fields
3/28/90 jmd ansi-fied
*/
#include "sed.h"
void sed_DeleteField(sed_type sed, int fieldno)
/*
Delete a field.
*/
{
menu_type menu;
menu = sed_GetMenu(sed);
menu_DeleteField(menu, fieldno);
/* adjust fieldno and fieldpos */
if (sed_GetFieldCount(sed) > 0) {
if (sed_GetFieldNo(sed) >= menu_GetFieldCount(menu)) {
sed_SetFieldNo(sed, menu_GetFieldCount(menu) - 1);
sed_SetRecordPos(sed, menu_GetFirstFieldPos(menu, sed_GetFieldNo(sed)));
}
/* reset the current field pointer */
sed_SetCurrField(sed, menu_GetField(menu, sed_GetFieldNo(sed)));
}
else {
sed_SetFieldNo(sed, -1);
sed_SetRecordPos(sed, NO_WRITEABLES);
sed_SetCurrField(sed, NULL);
}
}