Re: TIB: Convert
[Prev][Next][Index][Thread]
Re: TIB: Convert
It depends on your c compiler. Two people suggested C++ solutions, one example
included a class (cTIME). However, the simplest solution that will actually
teach you something is to do a delay loop.
void fDelay ()
{
for (unsigned long i=0; i < 60000; i++); // This will increment a variable
// until it reaches 60000. Length
// of time depends on computer speed.
return;
}
The next step is to find the function in your version of C that tells you if
there is anything in the keyboard buffer. Let's say that function is kbuf() and
returns true if there is a character (or more than one) in the buffer.
void fWaitForKeyPress()
{
while(!kbuf());
return;
}
The next step would be to empty the keyboard buffer (using getchar or similar).
Then find out the functions in your version of C which deal with time. Get the
time, and wait x seconds...
Have fun!
-Adam
ETTamme1@aol.com wrote:
>
> Hello my name is Eric.. and ... I have a problem with TI-basic.
> It was my first language, and then i wanted to get more and more of it, and
> now i need a bigger more powerfull language to satisfy me. alright alright,
> enough. Well anyway all of the above is true, TI basic(82-83-85-86) were my
> first languages,and now i want to expand. But i have a problem, ive been
> trying to learn C/C++ but its so different from basic that i remain
> unseuccsessfull. All i can do is make hello world programs that stay on the
> screen for 1/800th of a second cause i dont know what the C++ equavalent for
> "Pause" is. Well anyway, i want to know if any of you have made the jump
> that im trying to make and if you have any advice on how to make it easier.
> Thanks,
> ~Eric
References: