Changes

Jump to: navigation, search

Project R0.1 20123- OOP344

249 bytes added, 19:57, 14 October 2012
Step one
This method edits the C-style, null-terminated string pointed 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.
* '''''Initial Corrections'''''
*: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. 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.(to do this have a local variable for the offset that holds zero to be pointed instead of an external variable)*: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.(like the offset, to do this have a local variable for the cursor position that holds zero to be pointed instead of an external variable)
Your function does not allow the cursor to move before the start of the field or past the end of the field. If the field ends at the right edge of the screen, your function does not allow the cursor to the right of that edge.

Navigation menu