programming tools for Windows applications development
  Home  |   SwiftForth Archive  |   SwiftX Archive  |

Re: unexpected behavior of ACCEPT

From: Kenneth Butterfield <kbutterfield_at_lanl.gov>
Date: Tue, 03 May 2005 12:59:40 -0600

The docs say that=20

KEY? is a low level function that returns TRUE if a character is waiting.=
 (it does not remove this character from the input stream as shown by Q1)

ACCEPT -- in command window, text is displayed after the receipt of each=
 character.

-- so ACCEPT is ignoring the first waiting character, but not the following=
 -- nothing in the DOCS requires getting this first character, but many=
 versions of ACCEPT in SWIFTX do get this character as they are based on=
 KEY! Just something to be aware about I guess! If you must receive all=
 characters for communications then ACCEPT is not trustworthy from one FORTH=
 to another.

Ken B

At 05:06 PM 5/2/2005 -0700, you wrote:
>ACCEPT doesn't use KEY.
>
>>
>> Kenneth Butterfield (02.05. 15:43):
>>
>> > : q1 1000 ms key? key emit ;
>> > : q2 10000 ms key? if pad 10 accept pad swap dump then ;
>> >
>> > q1 (immediatly type 1) returns 1
>> > q2 (immediately type 1234) returns 234
>> > q2 (wait 20 seconds type 1234) returns 1234
>> >
>> > Where does the leading character go?
>>
>> I'd guess that that once key? has seen the 1 keypress, it's not
>> available to accept any more, as this event has already been handled and
>> forgotten.
>>
>> s.
>>
>> --
>> Stefan Schmiedl
>>=
 +-------------------------------+----------------------------------------+
>> |Approximity GmbH | EDV-Beratung Schmiedl =
 |
>> |http://www.approximity.com | Am Br=E4uweiher 4, 93499 Zandt, Germany=
  |
>> |mailto:stefan_at_approximity.com | Tel. (09944) 3068-98, Fax -97 =
 |
>>=
 +-------------------------------+----------------------------------------+
>> ----------------------------------------------------------------------
>> sftalk_at_forth.com The SwiftForth programming discussion email list
>> To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
>> For list command help, send subject "help" to sftalk-request_at_forth.com
>> Message archives are located at http://www.forth.com/archive/sftalk
>> ----------------------------------------------------------------------
>> This list is a forum for SwiftForth users. For product support and bug
>> reports, please send email to support_at_forth.com
>> ----------------------------------------------------------------------
>>
>>
>
>----------------------------------------------------------------------
>sftalk_at_forth.com The SwiftForth programming discussion email list
>To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
>For list command help, send subject "help" to sftalk-request_at_forth.com
>Message archives are located at http://www.forth.com/archive/sftalk
>----------------------------------------------------------------------
>This list is a forum for SwiftForth users. For product support and bug=20
>reports, please send email to support_at_forth.com
>----------------------------------------------------------------------

Dr. Kenneth B Butterfield

phone: 505 667 8944

PO Box 1663
ms J562=20
Los Alamos National Laboratory
Los Alamos New Mexico 87545

"I do not trust a computer that I am not carrying!"

----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Tue May 03 2005 - 12:09:14 PDT

This archive was generated by hypermail 2.2.0 : Thu Dec 04 2008 - 03:04:19 PST