![]() |
||
| Home | SwiftForth Archive | SwiftX Archive | |

The difference is accounted for by the fact that (as Leon pointed out)
SwiftForth's ACCEPT isn't built on KEY, whereas in Win32Forth it probably
is.
ANS Forth specifies that after KEY? returns TRUE the next use of KEY will
deliver the key, but it doesn't mention ACCEPT (nor is ACCEPT required to
use KEY). Therefore, either behavior is standard.
Ron's advice is good: ACCEPT should be used only when you're prepared to
tolerate its blocking behavior, and KEY?/KEY otherwise.
Cheers,
Elizabeth
> -----Original Message-----
> From: sftalk-bounce_at_forth.com [mailto:sftalk-bounce_at_forth.com]On Behalf
> Of Anil Rodrigues
> Sent: Thursday, May 05, 2005 11:06 AM
> To: sftalk_at_forth.com
> Subject: [sftalk] Re: unexpected behavior of ACCEPT
>
>
> for what it's worth, in SwiftF
>
> : try begin key? until pad 80 accept ;
> try bc def ok
> pad 10 dump
> 46EB07 62 63 20 64 65 66 20 20 20 20 bc def =
> ok
>
> That's by typing abc def, the 'a' disappears from the command line.
>
> In Win32F I get the full 'abc def'.
>
> Cheers! Anil
>
> -----Original Message-----
> From: Eglenn4511_at_aol.com [mailto:Eglenn4511_at_aol.com]
> Sent: Wednesday, May 04, 2005 5:42 PM
> To: sftalk_at_forth.com
> Subject: [sftalk] Re: unexpected behavior of ACCEPT
>
>
> =20
> In a message dated 5/2/2005 2:37:03 P.M. Mountain Standard Time, =20
> kbutterfield_at_lanl.gov writes:
>
> : 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?
>
> Ken B
>
>
>
> Very interesting. Here is what I got.using win32forth
> the 0 left on the stack came from somewhere ... I suspect I stopped =
> typing =20
> when key? accepted the first key=20
> q2 1234
> 5652 31 32 33 34 1234 ok
> =20
> This was most interesting without waiting for the time delay. Nothing =20
> appeared until the time delay was over. Then the hex representation of =
> the numbers=20
> appeared and the cursor sat behind the numbers. I pressed return and =
> '1234'=20
> appeared at the end of the line. I recognized the other numbers as the =
> address=20
> for pad. I 'typed' the contents of pad and as expected found 1234 as =
> below.
> 5652 4 type 1234 ok
> I didn't do the third part because I knew it would be accepted as a =
> numeric=20
> input. It doesn't go to pad because 'if' sees false.
> =20
> =20
> Charlie
>
>
> ----------------------------------------------------------------------
> 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
> ----------------------------------------------------------------------
>
> ----------------------------------------------------------------------
> 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
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Thu May 05 2005 - 11:31:57 PDT
This archive was generated by hypermail 2.2.0 : Thu Dec 04 2008 - 03:04:20 PST