Assignment 1: Q & A
Q & A
Q: How do I scroll through strings within a field?
A: To scroll through the string use pointer math. Use a pointer to point to where you want to start printing your string. Then use display to re-print your string using the new pointer instead of str.
Ex:
char* strStart;
strStart = str + yourOffsetHere;
display (strStart, row, col, fieldLength);
Submitted by: Jordan Theriault & Julian Burton
Q: What is the difference between terminating and aborting editing?
A: Terminating editing allows for the edited text to be saved, aborting it reverts the string to the original version.
Submitted by: Wes Hamilton & Joe Higginson
Q: Do we use consoleplus.cpp/.h or consolelineedit.cpp/.h for our A1 file compiling?
A: Your consolelineedit.cpp uses the consoleplus.h header file. There is no file named consoleplus.cpp or consolelineedit.h. (Submitted by Team42.)
Submitted by: Daniel Vescio & Alexandre Kostikov
Q: The parameter insertMode points to a bool variable that holds the current insert mode of the string. Do you want bool==true to be insert or overwrite? It isn't specified anywhere.
A: Since you're the one using your insertMode variable in your 'other letters' default case, you can set it to whatever you want and treat it as such Simply make sure you're being consistent in your code. (Submitted by Team42.)
Submitted by: Daniel Perrone and Michael LaMonaca
Q: In the program, we assume that the screen size is fixed. How would we change the program such that it prints the string for a variable field length i.e. the screen size can be changed at the user's discretion?
A: You can retrieve the screen size with console.getCols(); (or getRows() for rows) and use that value in your calculations for field-length, such as fieldLen=console.getCols()-4; (Submitted by Team42)
Submitted by: Gideon Thomas and Marie Karimizadeh
Q: When I try to run a1test on putty, my HOME key and END key don't work properly. What can I do to fix this?
A: Go to Connection >> Data, and change the string that says "xterm" to "linux". Make sure to save a new profile with this option; if you select a saved profile after making that change, it is not retained!
Submitted by: Kevin Kofler and Lucas Passarella, Team 9
Q: When compiling and running a1test with visual studio, the program crashes after sending some keystrokes with this error:
Critical error detected c0000374 Windows has triggered a breakpoint in a1.exe. This may be due to a corruption of the heap, which indicates a bug in a1.exe or any of the DLLs it has loaded.
I commented out my custom line edit code, leaving empty methods yet this still happens. If I compile with borland I can not reproduce this issue. I think borland uses a private heap.
A:
Submitted by: Team 6
Bug Report
- A1testborland.exe on A1 page has an error in its programming logic
Before
After
When in edit mode and when the cursor is over the second character, and the backspace key is used, the character not only gets deleted but the cursor moves right 4 characters. This is obviously not intentional.
Submitted by: Danny Perrone and Michael LaMonaca
- A1testborland.exe is inefficient when it comes to key presses. It calls the display function even if the string offset has not changed, causing the cursor-flicker when using left/right keys in quick succession.
Submitted by: Team42.
- A1testborland.exe has another error in its programming logic
When the string is at max length, if you press the left key and then right, the offset changes instead of the cursor position.
- Steps to recreate error
- type until max length is reached
- press left key
- press right key
Submitted by: Team4.
Possible Additional Features:
- Dumb word wrapping - Cut off string at the end of line and wrap it (Proposed by Team42)
- Smart word wrapping - Smart word wrapping - words are not cut off mid-word while wrapping (Proposed by Team42)
- Optimization - the 'test' compiled .exe has efficiency issues when scrolling around the string (Proposed by Team42)