Changes

Jump to: navigation, search

Line Editing Facility - OOP344 20113

167 bytes added, 21:52, 19 September 2011
makes no sense.
This methods edits the C-style, null-terminated string pointed to by str. The parameter row holds the row (0 is the top row) of the string on the screen. The parameter col holds the starting column (0 is the left-most column) on the screen. The parameter fieldLength holds the length of the editable field. The string may be larger than the field itself, in which case part of the string is hidden from view. The parameter maxStrLength holds the maximum length of the string, excluding the null byte. The parameter insertMode points to a bool variable that holds the current insert mode of the string. The parameter insertMode receives the address of a variable that stores the current editing mode - insert or overwrite. The parameter strOffset points to an int variable that holds the initial offset of the string within the field; that is, the index of the character in the string that initially occupies the first character position in the field. The parameter curPosition points to an int variable that holds the initial cursor position within the field; that is, the index of the character in the field at which the cursor is initially placed.
If the initial offset is beyond the end of the string, your function resets the offset to the length of the string; that is, to the index of the character immediately beyond the end of the string. <span style="color:#FF0000">If no offset variable is pointed to; that is, if the address of the variable is NULL, your function sets the offset to the index of the first character in the string; that is, to 0.(Need clarification, can't give a value to a NULL pointer. See below...)</span><br /><code>if(strOffset == NULL) *strOffset = 0;</code>
If the initial cursor position is beyond the end of the field, your function resets the position to the last character in the field. If the position is beyond the end of the string, your function resets the position to that immediately beyond the end of the string. If no cursor position variable is pointed to; that is, if the address of the variable is NULL, your function sets the cursor position to the first position in the field; that is, to position 0.
1
edit

Navigation menu