Computer Science Canada Getch help |
Author: | TokenHerbz [ Tue Sep 06, 2005 6:34 pm ] | ||
Post subject: | Getch help | ||
I cant find a good tutorial of getch... Anyways, i think rather then useing get ans (which will want a number) getch is to take in ANY character correct? Anyways, if im wrong correct me, otherwise help my understand this...
Yeah i get errors... Dont laught.. Im horrible at this, meanwhile explaine getchar, and hetch, (or the ones kinda like that) Please explain there use's, and give me a simple example... Thank you, and like i said, theres no tut which helped me. |
Author: | TokenHerbz [ Tue Sep 06, 2005 6:38 pm ] | ||
Post subject: | |||
i got it working with letters, but i cant get it to work with numbers...
|
Author: | jamonathin [ Tue Sep 06, 2005 6:45 pm ] | ||||
Post subject: | |||||
First of all, 'getch' only takes ': string (1)' variables (it's probabily in the F10 area). And so what happens is it "getch's" whatever is pressed, without displaying it. Here is what you needed your program to do. If you take out the comment, theres no more blinking light (cursor).
Now after you figure that out, you can play with it, and make password things, here's an example thatrelates to that last program.
|
Author: | TokenHerbz [ Tue Sep 06, 2005 7:21 pm ] |
Post subject: | |
ok, but i want to getch numbers... How can u get a number like getch? so that if i press say A, and it was a proc, i can call it... or if i press 1, then ill do what ever..., like i sayd, i want to use numbers |
Author: | jamonathin [ Tue Sep 06, 2005 8:28 pm ] | ||
Post subject: | |||
Read through what I wrote. Getch can ONLY use : string (1), not any integer value. We can play around with our inputed variabled, and change it into an integer, but we cannot GETCH ( var :int ). If you are "getching" for a number, use quotes around it in you if statement. Just like I did in that previous post. Here is another sample program. . .
|
Author: | Cervantes [ Tue Sep 06, 2005 8:37 pm ] |
Post subject: | |
I wouldn't expect you to understand the code that Jamonathin just posted (the type conversion parts) so, if you wish, you may learn about them in the String Manipulation Tutorial. (It's the second section.) |
Author: | TokenHerbz [ Wed Sep 07, 2005 1:06 am ] |
Post subject: | |
Thank you. |