Changes

Jump to: navigation, search

Project R0.1 20131- OOP344

5,395 bytes added, 15:12, 6 February 2013
Help
! Question!! Comments
|-
|Does ReadOnly if statement work like ESCAPE key ? (Store I can't compile the cio_test.o with the string in another variable console and bconsole file. It keeps telling me undefined reference to CIO_TABSIZE but I've ran and replace it)the cio_test. ? And, how do you guys initialize cpp and passed all the global variable for CIO_TABSIZE ? Do tests already. I need to specify 've already declared the link tabsize in console header and set it in console.h file as well? (What My files on matrix are up to date so I really have no idea what I did was'm doing wrong.||<s>Make sure you have pulled the newest versions of bconsole.h, and bconsole. cpp, declare extern unsigned int CIO_TABSIZE=4 in the console.h file, then almost re-declare it in console.cpp).: D || (by initializing it as 'unsigned int CIO_TABSIZE in CIO_TABSZIE= 4; '). That's the only thing I can think of (I know it happened to me) Another thing I did was for testing purposes I initialized cio_tabsize in cio_test.cpp which also had me baffled for a few minutes (make sure to change it back to console.cpp if that's the case):p ALSO make sure your bconsole.h, and extern unsigned int CIO_TABSIZE; in console.hare also in the directory you are compiling cio_test.o inside of (i know the submission doesn't include those two files in the g++ compile command but they still have to be there)</s> The '''CIO_TABSIZE''' was declared outside the cio namespace, now it is fixed!
|-
|I'm stuck on test 4.4 where toggling insert mode changes the *insertMode between 1 and 0. I tried assigning *insertMode to 0 in the else statement in the if(*insertMode){} clause. I'm not sure if I'm making some kind of rookie mistake please HELP!!!!|| How I did it was if (*insertMode) != true make it true else make it false. -kpersaud <hr/> this was actually very simple: http://www.noobiedev.com/oop344/oop34-r-01-insert-mode/ <hr/> Spike, left a better method in the comments <hr/> Haha Thanks I managed to figured it out already but all your solutions are much better than mine :)<hr/>|-|Hi, the cio_test.cpp is V '''0.94.1''' but the cio_test.o on matrix is just V '''0.94'''. Is this normal or did I copied the wrong test file on matrix?|| The correct 0.94.1 cio_test.o should be up on matrix. Try $cp ~fardad.soleimanloo/cio_test.o - phuang19|-Can anyone explain me the 4.23 and 4.24 and 5 from cio_test? 4.23: Escape when IsTextEditor=0, hit HOME key, then 'a' 'b' 'c' and then ESCAPE to test. It seems no keys should work in this test.. I am not sure 4.23 is about ReadOnly. 4.24 works fine but i do not really know why! LOL || 4.23: test to see if your '''ESC''' function works<br />4.24: this is not documented, but '''ESC''' function does not apply when '''IsTextEditor==true''', so 4.24 test that your ESC '''DOES NOT''' work when '''IsTextEditor==1'''<br />5. does nothing, let you play around with str to see if something is amiss <br />-bli64|-|Does ReadOnly if statement work like ESCAPE key ? (Store the string in another variable and replace it). ? And, how do you guys initialize the global variable for CIO_TABSIZE ? Do I need to specify the link in console.h file as well? (What I did was.. unsigned int CIO_TABSIZE=4 in console.cpp).: D || unsigned int CIO_TABSIZE = 4; in console.cpp and extern unsigned int CIO_TABSIZE; in console.h <hr /> ReadOnly does not work like the ESCAPE key in non text editior mode. It should prevent the user from making any modifications on str. For example: when the user presses the DEL key in Read only mode, it should not remove the character that is currently on the cursor. Instead the function should return DEL and do nothing to str. -- yhwong6|-|If IsTextEditor is true and the value of<u> *strOffset is changed at any time,</u> then terminate the edit function immediately and return 0; CAN SOMEONE explain what it means.. please : (- Solved! Thank you!|| It means when you move cursor to show the hidden characters or to hide shown characters(move to left or right) if IsTextEditor==True, then terminate the edit function; <br/>*strOffset is the number of characters of the left postion of string that not be displayed within the text-field. <br/>
At frist, you need store the original value of *strOffset, then everytime you press key, test if *strOffset is different from the original value, if it is then exit function and return 0;--hqiao3<br/>
|-
Thank you, fjzhou. I wonder why I didn't use any code from XMOVER. If you are right, then we have to keep tracking the cursor position on the screen by using getPos() function and comparing with the getCols()? However, I don't think that would be a problem since we keep adjusting the strOffset if the curPosition is at the end of the field. Then the last character of the string will not be at the edge of the screen and the cursor will be. So why would we put the cursor on the last character of the string? -Chun
|-
|Can someone tell why "TAB" key does't work on the matrix using PUTTY. I have set the keybord already........hqiao3||Make sure you follow these settings to setup your putty terminal client: [http://zenit.senecac.on.ca/wiki/index.php/Project_R0.1_20131-_OOP344#Notes Putty settings]
|-
| Im having problems with the initial corrections with the offset and curpos. test 4.1 - when i have to correct curpos 40 to 19, program crashes. I know it has to do with the creating a local variable instead of pointing to external. <br/> here is my code that crashes the program: <br/> http://www.noobiedev.com/oop344/oop344-release-0-1-bug/ || Create two local variables to store *strOffset & *curPosition,the purpose of doing this is:<br/>
<hr/>
I saw your code, I think there might be not correct in line 9. 'maxStrLength' is not Length of *Str (len of "abc\0abcd" is 4, but the max size of str may be 10. when display the *str, the cursor will stay on the wrong position. --hqiao3
<hr />
|-
|My HOME and END keys don't work on putty cio_test.o, but they all work well on visual studio when I run consoleTester.cpp. I have no idea about why they don't work on putty. When I hit HOME or END, there is nothing changed. Please help me :( ....Ran|| Have you setup PUTTY's keybord before you logon matrxi using putty? if not, please see 'Notes' item aboved in this page.--hqiao3<br />Thank you. That's the problem. --Ran
|-
|I need clarification as to what the backspace key should do given the *curPosition = 0 and the *strOffset != 0. Should the backspace key continue to delete characters by decreasing the offset, or should the backspace key simply sound the alarm()? I have posted the code on my blog in case my explanation sucks. http://csho3.wordpress.com/2013/02/04/r-01-backspace-key/ -- csho3 || If *cuPosition = 0 and *strOffset > 0 , that means there are still things that can be deleted, However, it doesn't make sense to delete stuff you cant see. So the logic is: Shifting the offset to the field and then working from there. How much *strOffset to adjust?, I'll let you think about that. (if stroffset > field length?, stroffset < fieldlength?) - fjzhou|-|Friends; on 4.28 in cio_test.cpp if i was pressing escape without following the instructions then I passed it but doing instructions it fails ...do anybody knows..(Pankaj Sama) ||Because escape is to put everything back to its original state, since you did nothing, every stayed the same and program thinks you did that in your escape logic.
|-
|I am compiling cio_test.cpp on my MVS, but there is no test. What am I doing wrong?<br> UPDATE: Yes, I have all 5 files. After compile I have error message "The system cannot find the file specified." and "Build failed" on the bottom of the MVS window. || if you have all five files(console.cpp,console.h,bconsole.h,bconsole.cpp, and cio_test.cpp) then create a new project with these files and press "Ctrl+F5". if you do not have any errors, you must see test in new prompt window...(Pankaj Sama)<hr> If you have all 4 files in a project, and then tried to compile cio_test.cpp by opening it in VS, and without including it in the project (by right clicking the sources folder and clicking add existing item-> the item being cio_test.cpp)Visual will just ignore it at compile time, or give it it's own project...which is useless without those other files. If you are running a test main, make sure to exclude that from project when you include cio_test, as they are both main()
|}
==Help Needed==
 
==Blog Posts==
=Submission=
==Common Submission mistakes==* Submitting the assignment with old version of cio_text.o*: ''Make sure you copy the latest version (currently 0.94.1) from my account : $cp ~fardad.soleimanloo/cio_test.o* Using tab character''*: ''As mentioned in class using tab character in your text editor makes the indentation of your code different in different editors, please make sure before submission you go to the settings of your development environment and make sure it uses spaces instead of tab character.'' ==Tester Demo==To see how tester runs, you can run on Matrix (only use putty with the setting stated at [[#Notes|Notes]]) run:<big><pre>$ ~fardad.soleimanloo/cio_test</pre></big> ==How to Compile== Compile and test your upgrade code with your the test -main , in the following three command-line environments: and visual studio.
Local PC: Borland 5.5
bcc32 bconsole.cpp console.cpp cio_test.cpp
 
Local PC: Microsoft .net
Local Mac: (use -lcurses to link curses library)
g++ bconsole.cpp console.cpp cio_test.cpp -lncurses -Wno-write-strings
Local PC: Visual Studio.net
 
==How to submit==
For submission purposes, your solution must compile, link, and run without errors in each environment.
==Tester Demo==
To see how tester runs, you can run on Matrix (only use putty with the setting stated at [[#Notes|Notes]]) run:
<big><pre>
$ ~fardad.soleimanloo/cio_test
</pre></big>
 
==Submission details==
The due date for submission is: Tue, Feb 5th 23:59
First pull the changes of the two files bconsole.cpp and bconsole.h to version 1.02 (Feb 1, 2013) from the console directory in notes repository of your section.

Navigation menu