Brief Index      Full Index      Events Index      I.M. Reference

Edit_Text

Functions

void Edit_Text (HC_KEY key, int row, int column, int erase, int ndelete, const char *new_text)

Function Documentation

void Edit_Text ( HC_KEY  key,
int  row,
int  column,
int  erase,
int  ndelete,
const char *  new_text 
)

Manipulate the characters in a previously defined string.

Parameters:
key- The identifier returned by a previous Insert_Text() or Insert_Text_With_Encoding() .
row- The row of text that the Edit operates within. This should be always specified as zero.
column- The character position within the row where the Edit should start. The leftmost character in any row is at position zero.
erase- The number of characters to change to blanks.
ndelete- The number of characters to remove from this row. If spec ified as "-1", the number deleted will be equal to length of new_text inserted.
new_text- Characters to be inserted (if any).

DETAILS

If you just want to put up and remove messages use simple segments, either create and delete them or just flush them out. But if your text is long and complicated, Edit_Text() may be of value to facilitate incremental changes.

The three possible operations---erase, delete, and insert new_text---are performed consecutively in that order. Note, specifying a -1 for ndelete gives the effect of a "replace" operation, without having to count the characters yourself.

If key resulted from a call to Insert_Text_With_Encoding() , then the "encoding" of new_text is assumed to be the same as that of the original text. If in doubt, use Show_Text_Encoding() first.

If the number of characters inserted does not equal the number deleted, the overall length of the stored text will be changed. Text alignment will be recomputed as needed.

NOTES

RESTRICTIONS

See also:
Flush_Contents, Flush_By_Key, Insert_Text, Set_Text_Alignment, Set_Text_Font, Scroll_Text, Show_Text_Encoding, Compute_Text_From_Text16.

Brief Index      Full Index      Events Index      I.M. Reference