Keywords: lpg

Next: 8.6.3 Delete Characters/Lines Up: 8.6 Output Previous: 8.6.1 Formatted Output

## 8.6.2 Insert Characters/Lines

- `int insch(c)`
  `int winsch(win, c)`
  `int mvinsch(y,x,c)`
  `int mvwinsch(win,y,x,c)`
  Character `ch` is inserted to the left of the cursor and all characters are moved one position to the right. The character on the right end of the line may be lost).
- `int insertln()`
  `int winsertln(win)`
  Insert a blank line above the current one. (The bottom line will be lost).
- `int insdelln(n)`
  `int winsdelln(win, n)`
  For positive `n` these functions will insert n lines above the cursor in the appropriate window (so the n bottom lines will be lost). When `n` is negative, n lines under the cursor will be deleted and the rest will moved up.
- `int insstr(str)`
  `int insnstr(str, n)`
  `int winsstr(win, str)`
  `int winsnstr(win, str, n)`
  `int mvinsstr(y, x, str)`
  `int mvinsnstr(y, x, str, n)`
  `int mvwinsstr(win, y, x, str)`
  `int mvwinsnstr(win, y, x, str, n)`
  These functions will insert `str` in the current line left from the cursor (as many characters as fit to the line). The characters on the right of the cursor are moved right and will be lost when the end of the line is reached. The cursor position is not changed.

  `y` and `x` are the coordinates to which the cursor is moved before `str` will be inserted, `n` is the number of characters to insert (with `n`=0 the entire string is inserted).