Changes

Jump to: navigation, search

Line Editing Facility - OOP344 20113

50 bytes added, 12:02, 22 September 2011
edit() function
===edit() function===
<big><pre> int edit(char *str, int row, int col, int fieldLength, int maxStrLength, bool* insertMode, int* strOffset, int* curPosition)</pre></big>
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.
You may assume that it is the calling program's responsibility to ensure that the string array is large enough to handle maxStrLength characters and that the starting screen position provides enough room (on the screen) for the field, etc.
 
===Tester Program===
===Grading===

Navigation menu