Coder's Guild Mailing List

Re: a bit of help

Posted by Sharvil Nanavati on 2000-10-25

> Hi.
>   I need a bit of help with coding. I was wondering if there is a
> part of 
> C++ that i need to study in order to perform this task.

First of all, I think it would help to know what platform you're making
this for (DOS, Windows, Linux, etc.)

> study it would greatly appreciated. Also i was wondering how to set a
> 
> trigger to the press of a button. for instance to decrease a number
> by x 
> upon the press of button 'L'.
> -Thanks in advance

Umm... again, press of the key 'L' on the keyboard? Or the press of the
'L' key on a Playstation? If it was on the keybaord (and for DOS in C),
I would do something like this:

char c;
int my_number = 165498; /* or whatever */
int decrease_by = 5;

for(;;) /* some loop */
{
    c = getch();
    if(c == 'L')
        my_number -= decrease_by;
}

I know this probably doesn't help much, but more info would be
required.

Cheers,
Sharvil Nanavati

__________________________________________________
Do You Yahoo!?
Yahoo! Messenger - Talk while you surf!  It's FREE.
http://im.yahoo.com/