[Coco] C and BASIC09 (Auto-discard notification)

Robert Gault robert.gault at worldnet.att.net
Sat May 15 22:27:37 EDT 2004


Dennis Bathory-Kitsz wrote:
>>Date: Sat, 15 May 2004 20:44:50 -0500
>>From: Mannequin* <mannequin at charter.net>
>>To: CoCoList for Color Computer Enthusiasts <coco at maltedmedia.com>
>>Subject: Re: [Coco] C and BASIC09

>>On Fri, 14 May 2004 22:29:18 -0400
>>Robert Gault <robert.gault at worldnet.att.net> wrote:
>>
>>
>>>Mannequin* wrote:
>>>
>>>>I know everyone is in Chicago by now, but the few of you who are
>>>>left can probably help me out here. :)
>>>>
>>>>I know that there is a way to run C functions through a BASIC09
>>>>program, but I was wondering if there was a way to run BASIC09
>>>>procedures through a C program and receive an integer value back?
>>>>
>>>>Thanks!
>>>>-M.
>>>>
>>
>>...
>>
>>
>>>If you want more details, please be very specific about what you want
>>>to do. You may find that invoking Basic09 is not the best choice.
>>
>>I can see why it wouldn't be the best method. In your (and other's)
>>opinion, what is the best way to catch key strokes from a keyboard in C
>>for the Coco? I have a short function here that I got through another
>>Coco list:
>>
>>#include <stdio.h>
>>#include <sgstat.h>
>>
>>int inkey (void)
>>{
>> char ch;
>>
>> fflush (stdout);
>>
>> if (getstat (1, 0))
>>   return 0;
>>
>> read (0, &ch, 1);
>>
>> return ch;
>>}
>>
>>Thanks for any help you can give.
>>-M.
>>
> 
> 

My suggestion would be to look at the getchar standard library call. 
However, you have still not said exactly what you are trying to 
accomplish. Do you want your program to respond to the keyboard 
regardless of where you are in your program or do you only need keyboard 
input at a specific time? How many characters will you need to trap? 
Will you need to process the keyboard input or only know that some key 
has been pressed?




More information about the Coco mailing list