home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QBasic & Borland Pascal & C
/
Delphi5.iso
/
C
/
Samples
/
CSAPE32.ARJ
/
SOURCE
/
CSSRC
/
FLDPUSHL.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-03-28
|
1KB
|
53 lines
/*
fldpushl.c 5/11/88
% field_PushLeft
C-scape 3.2
Copyright (c) 1986, 1987, by Oakland Group, Inc.
ALL RIGHTS RESERVED.
Revision History:
-----------------
3/28/90 jmd ansi-fied
*/
#include "field.h"
char field_PushLeft(field_type f, int fpos, char c)
/*
modifies: the field.
effects: inserts the scancode at fpos, pushes the
characters to the left:
|x hell mom|
^
| hello mom| ---> return('x');
^
returns: the character that falls off the edge. If nothing falls off
the edge, return '\0'.
*/
{
char edge_char;
int recpos;
/* Remember the edge character. */
edge_char = f->record[0];
/* push to the left */
for (recpos = 0; recpos < fpos; recpos++) {
f->record[recpos] = f->record[recpos+1];
if (f->merge != NULL) {
f->merge[f->r2m[recpos]] = (f->record[recpos+1] != '\0') ?
f->record[recpos+1] :
MRGPADCHAR;
}
}
/* insert the char */
field_SetChar(f, fpos, c);
return(edge_char);
}