To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.pbforthOpen lugnet.robotics.rcx.pbforth in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / pbFORTH / 617
616  |  618
Subject: 
Re: IR problems
Newsgroups: 
lugnet.robotics.rcx.pbforth
Date: 
Sat, 31 Jan 2004 03:36:30 GMT
Viewed: 
6943 times
  
In lugnet.robotics.rcx.pbforth, Ralph Hempel wrote:
> > Ralph, one more question. Are there conditions where the word EKEY would wait
> > for input (like KEY)? It seems to happen in my program.
> 
> EKEY always waits for input. Use EKEY? to see if anything is available...
> 
> Looking at the source, I see that there is a possiblity that in the time
> between checking for a character with EKEY? and actually reading
> it with EKEY, that an error can occur and casue EKEY to block even
> though you think it should not.
> 
> You should always use EKEY? before EKEY, but traditional Forth does not
> let you check for errors in EKEY so...
> 
> How should we handle this? I can make a new word that returns the actual
> byte in the low order bits and additional info in the high byte...
> 
> If the high byte is 0, then there is no data.
> 
> What should we call the word?
> 
> Ralph

I did not explain my problem properly but you got it anyway! I do use EKEY?
before EKEY, but sometimes EKEY seems to block. Thanks for taking your time to
look into this.

As for the new word (wow!), in Forth-79, there was a word called ?KEY
that scanned the keyboard and returned 0 if no key was pressed or the ascii code
of the character. Can we go that way?

Thank you very much.



Message is in Reply To:
  RE: IR problems
 
(...) EKEY always waits for input. Use EKEY? to see if anything is available... Looking at the source, I see that there is a possiblity that in the time between checking for a character with EKEY? and actually reading it with EKEY, that an error can (...) (23 years ago, 30-Jan-04, to lugnet.robotics.rcx.pbforth)

7 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR