Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #32547 > unrolled thread

What for Break Key No Work?

Started byJason Damisch <jasondamisch@yahoo.com>
First post2014-07-22 14:44 -0700
Last post2014-07-30 22:55 -0700
Articles 17 on this page of 97 — 20 participants

Back to article view | Back to comp.lang.forth


Contents

  What for Break Key No Work? Jason Damisch <jasondamisch@yahoo.com> - 2014-07-22 14:44 -0700
    Re: What for Break Key No Work? Roger Levy <roger.levy@gmail.com> - 2014-07-22 14:50 -0700
      Re: What for Break Key No Work? Jason Damisch <jasondamisch@yahoo.com> - 2014-07-22 15:04 -0700
        Re: What for Break Key No Work? Jason Damisch <jasondamisch@yahoo.com> - 2014-07-22 16:03 -0700
        Re: What for Break Key No Work? BruceMcF <agila61@netscape.net> - 2014-07-22 18:34 -0700
          Re: What for Break Key No Work? Jason Damisch <jasondamisch@yahoo.com> - 2014-07-22 19:32 -0700
            Re: What for Break Key No Work? Spam@ControlQ.com - 2014-07-22 22:43 -0400
              Re: What for Break Key No Work? Jason Damisch <jasondamisch@yahoo.com> - 2014-07-23 09:57 -0700
                Re: What for Break Key No Work? "Elizabeth D. Rather" <erather@forth.com> - 2014-07-23 07:12 -1000
                  Re: What for Break Key No Work? Jason Damisch <jasondamisch@yahoo.com> - 2014-07-23 10:15 -0700
            Re: What for Break Key No Work? rickman <gnuarm@gmail.com> - 2014-07-22 22:44 -0400
              Re: What for Break Key No Work? Jason Damisch <jasondamisch@yahoo.com> - 2014-07-23 09:58 -0700
                Re: What for Break Key No Work? "Elizabeth D. Rather" <erather@forth.com> - 2014-07-23 21:28 -1000
            Re: What for Break Key No Work? BruceMcF <agila61@netscape.net> - 2014-07-23 13:12 -0700
              Re: What for Break Key No Work? Jason Damisch <jasondamisch@yahoo.com> - 2014-07-23 14:52 -0700
                Re: What for Break Key No Work? Mark Wills <markwills1970@gmail.com> - 2014-07-24 01:54 -0700
                  Re: What for Break Key No Work? rickman <gnuarm@gmail.com> - 2014-07-24 07:54 -0400
                    Re: What for Break Key No Work? Mark Wills <markwills1970@gmail.com> - 2014-07-24 06:49 -0700
                      Re: What for Break Key No Work? rickman <gnuarm@gmail.com> - 2014-07-24 10:39 -0400
                        Re: What for Break Key No Work? bruce.mcfarling@gmail.com - 2014-07-24 08:52 -0700
                          Re: What for Break Key No Work? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-07-24 13:07 -0500
                            Re: What for Break Key No Work? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-07-25 10:50 +0000
                              Re: What for Break Key No Work? Bernd Paysan <bernd.paysan@gmx.de> - 2014-07-25 14:38 +0200
                                Re: What for Break Key No Work? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-07-25 17:07 +0000
                                  Re: What for Break Key No Work? Bernd Paysan <bernd.paysan@gmx.de> - 2014-07-26 00:36 +0200
                                    Re: What for Break Key No Work? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-07-27 13:47 +0000
                              Re: What for Break Key No Work? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-07-25 09:21 -0500
                                Re: What for Break Key No Work? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-07-25 17:10 +0000
                                  Re: What for Break Key No Work? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-07-26 04:38 -0500
                                    Re: What for Break Key No Work? Bernd Paysan <bernd.paysan@gmx.de> - 2014-07-26 15:56 +0200
                                    Re: What for Break Key No Work? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-07-27 13:27 +0000
                                      Re: What for Break Key No Work? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-07-27 09:36 -0500
                                        Re: What for Break Key No Work? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-07-28 11:38 +0000
                                          Re: What for Break Key No Work? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-07-28 10:42 -0500
                                Re: What for Break Key No Work? "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-07-25 16:56 -0400
                                  Re: What for Break Key No Work? "Elizabeth D. Rather" <erather@forth.com> - 2014-07-26 09:33 +0000
                          Re: What for Break Key No Work? rickman <gnuarm@gmail.com> - 2014-07-24 19:40 -0400
                            Re: What for Break Key No Work? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-07-25 00:00 +0000
                              Re: What for Break Key No Work? rickman <gnuarm@gmail.com> - 2014-07-24 22:17 -0400
                            Re: What for Break Key No Work? bruce.mcfarling@gmail.com - 2014-07-25 06:54 -0700
                            Re: What for Break Key No Work? "Elizabeth D. Rather" <erather@forth.com> - 2014-07-25 13:13 -0400
                              Re: What for Break Key No Work? rickman <gnuarm@gmail.com> - 2014-07-25 13:24 -0400
                                Re: What for Break Key No Work? bruce.mcfarling@gmail.com - 2014-07-25 14:37 -0700
                                  Re: What for Break Key No Work? rickman <gnuarm@gmail.com> - 2014-07-25 19:01 -0400
                                    Re: What for Break Key No Work? bruce.mcfarling@gmail.com - 2014-07-25 16:20 -0700
                                      Re: What for Break Key No Work? rickman <gnuarm@gmail.com> - 2014-07-25 22:02 -0400
                                        Re: What for Break Key No Work? rickman <gnuarm@gmail.com> - 2014-07-25 22:17 -0400
                                        Re: What for Break Key No Work? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-07-26 09:09 +0000
                                          Re: What for Break Key No Work? rickman <gnuarm@gmail.com> - 2014-07-26 05:36 -0400
                                        Re: What for Break Key No Work? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-07-26 04:41 -0500
                                          Re: What for Break Key No Work? rickman <gnuarm@gmail.com> - 2014-07-26 22:50 -0400
                                            Re: What for Break Key No Work? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-07-27 02:49 -0500
                                              Re: What for Break Key No Work? rickman <gnuarm@gmail.com> - 2014-07-27 15:08 -0400
                                                Re: What for Break Key No Work? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-07-27 14:11 -0500
                                                Re: What for Break Key No Work? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-07-28 12:00 +0000
                                                  Re: What for Break Key No Work? rickman <gnuarm@gmail.com> - 2014-07-28 10:41 -0400
                                            Re: What for Break Key No Work? Bernd Paysan <bernd.paysan@gmx.de> - 2014-07-27 14:31 +0200
                                        Re: What for Break Key No Work? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-07-27 13:08 +0000
                                          Re: What for Break Key No Work? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-07-27 19:37 +0000
                                          Re: What for Break Key No Work? rickman <gnuarm@gmail.com> - 2014-07-27 16:35 -0400
                                            Re: What for Break Key No Work? "Elizabeth D. Rather" <erather@forth.com> - 2014-07-27 22:24 +0000
                                              Re: What for Break Key No Work? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-07-28 13:14 +0000
                                            Re: What for Break Key No Work? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-07-28 03:41 -0500
                                            Re: What for Break Key No Work? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-07-28 12:09 +0000
                                              Re: What for Break Key No Work? rickman <gnuarm@gmail.com> - 2014-07-28 10:48 -0400
                                                Re: What for Break Key No Work? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-07-28 15:29 +0000
                                                  Re: What for Break Key No Work? rickman <gnuarm@gmail.com> - 2014-07-28 14:30 -0400
                                                    Re: What for Break Key No Work? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-07-29 08:12 +0000
                                            Re: What for Break Key No Work? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-07-28 13:10 +0000
                                        Re: What for Break Key No Work? bruce.mcfarling@gmail.com - 2014-07-27 11:33 -0700
                                          Re: What for Break Key No Work? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-07-28 11:55 +0000
                                            Re: What for Break Key No Work? "Alex McDonald" <blog@rivadpm.com> - 2014-07-28 14:03 +0100
                                    Re: What for Break Key No Work? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-07-27 13:02 +0000
                                Re: What for Break Key No Work? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-07-26 08:57 +0000
                                  Re: What for Break Key No Work? rickman <gnuarm@gmail.com> - 2014-07-26 05:05 -0400
                                    Re: What for Break Key No Work? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-07-26 09:20 +0000
              Re: What for Break Key No Work? "Alex McDonald" <blog@rivadpm.com> - 2014-07-23 23:48 +0100
              Re: What for Break Key No Work? rickman <gnuarm@gmail.com> - 2014-07-24 04:53 -0400
                Re: What for Break Key No Work? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-07-24 10:59 +0000
                  Re: What for Break Key No Work? mhx@iae.nl - 2014-07-24 04:23 -0700
            Re: What for Break Key No Work? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-07-24 19:28 +0000
              Re: What for Break Key No Work? "Elizabeth D. Rather" <erather@forth.com> - 2014-07-24 13:01 -1000
                Re: What for Break Key No Work? Roelf Toxopeus <rt4all@notthis.hetnet.nl> - 2014-07-25 10:13 +0200
        Re: What for Break Key No Work? "Elizabeth D. Rather" <erather@forth.com> - 2014-07-22 17:11 -1000
          Re: What for Break Key No Work? Jason Damisch <jasondamisch@yahoo.com> - 2014-07-23 09:59 -0700
    Re: What for Break Key No Work? David Schultz <abuse@127.0.0.1> - 2014-07-22 17:47 -0500
      Re: What for Break Key No Work? rickman <gnuarm@gmail.com> - 2014-07-22 19:12 -0400
        Re: What for Break Key No Work? Jason Damisch <jasondamisch@yahoo.com> - 2014-07-22 16:21 -0700
          Re: What for Break Key No Work? rickman <gnuarm@gmail.com> - 2014-07-22 22:51 -0400
    Re: What for Break Key No Work? Matthias Trute <matthias.trute@gmail.com> - 2014-07-23 02:18 -0700
    Re: What for Break Key No Work? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-07-23 13:21 +0000
      Re: What for Break Key No Work? Jason Damisch <jasondamisch@yahoo.com> - 2014-07-23 10:02 -0700
      Re: What for Break Key No Work? Bernd Paysan <bernd.paysan@gmx.de> - 2014-07-24 04:10 +0200
    Re: What for Break Key No Work? mhx@iae.nl - 2014-07-23 13:45 -0700
    Re: What for Break Key No Work? BruceMcF <agila61@netscape.net> - 2014-07-23 16:37 -0700
    Re: What for Break Key No Work? "Clyde W. Phillips Jr." <cwpjr02@gmail.com> - 2014-07-30 16:13 -0700
    Re: What for Break Key No Work? francois.ganza@wanadoo.fr - 2014-07-30 22:55 -0700

Page 5 of 5 — ← Prev page 1 2 3 4 [5]


#32627

Fromalbert@spenarnc.xs4all.nl (Albert van der Horst)
Date2014-07-24 19:28 +0000
Message-ID<53d15e47$0$4662$e4fe514c@dreader36.news.xs4all.nl>
In reply to#32558
In article <9f9d1c77-20a0-47f8-b303-6f76ff797eb7@googlegroups.com>,
Jason Damisch  <jasondamisch@yahoo.com> wrote:
>On Tuesday, July 22, 2014 6:34:56 PM UTC-7, BruceMcF wrote:
>
>Everything you said makes sense, but I don't understand why it isn't
>possible for an interrupt to just grab the system and drop me back onto
>the Forth prompt.

It can and it will in gforth
( or in lina 32 bits, after
   WANT DO-DEBUG
   DO-DEBUG
. )

Of course under linux, your "break" is the terminate signal,
aka control c. The terminate signal can be sent to your rogue
forth if you know its pid.

>
>Jason

Groetjes Albert
-- 
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

[toc] | [prev] | [next] | [standalone]


#32628

From"Elizabeth D. Rather" <erather@forth.com>
Date2014-07-24 13:01 -1000
Message-ID<dK-dnSHvvpb8DUzOnZ2dnUVZ_rudnZ2d@supernews.com>
In reply to#32627
On 7/24/14 9:28 AM, Albert van der Horst wrote:
> In article <9f9d1c77-20a0-47f8-b303-6f76ff797eb7@googlegroups.com>,
> Jason Damisch  <jasondamisch@yahoo.com> wrote:
>> On Tuesday, July 22, 2014 6:34:56 PM UTC-7, BruceMcF wrote:
>>
>> Everything you said makes sense, but I don't understand why it isn't
>> possible for an interrupt to just grab the system and drop me back onto
>> the Forth prompt.
> 
> It can and it will in gforth
> ( or in lina 32 bits, after
>     WANT DO-DEBUG
>     DO-DEBUG
> . )
> 
> Of course under linux, your "break" is the terminate signal,
> aka control c. The terminate signal can be sent to your rogue
> forth if you know its pid.
> 

Which is apparently what SwiftForth on my Mac does, because it handles
Jason's case just fine.

Cheers,
Elizabeth

-- 
==================================================
Elizabeth D. Rather   (US & Canada)   800-55-FORTH
FORTH Inc.                         +1 310.999.6784
5959 West Century Blvd. Suite 700
Los Angeles, CA 90045
http://www.forth.com

"Forth-based products and Services for real-time
applications since 1973."
==================================================

[toc] | [prev] | [next] | [standalone]


#32637

FromRoelf Toxopeus <rt4all@notthis.hetnet.nl>
Date2014-07-25 10:13 +0200
Message-ID<53d2118b$0$22269$703f8584@textnews.kpn.nl>
In reply to#32628
On 25/07/2014 01:01, Elizabeth D. Rather wrote:
> On 7/24/14 9:28 AM, Albert van der Horst wrote:
>> In article <9f9d1c77-20a0-47f8-b303-6f76ff797eb7@googlegroups.com>,
>> Jason Damisch  <jasondamisch@yahoo.com> wrote:
>>> On Tuesday, July 22, 2014 6:34:56 PM UTC-7, BruceMcF wrote:
>>>
>>> Everything you said makes sense, but I don't understand why it isn't
>>> possible for an interrupt to just grab the system and drop me back onto
>>> the Forth prompt.
>>
>> It can and it will in gforth
>> ( or in lina 32 bits, after
>>      WANT DO-DEBUG
>>      DO-DEBUG
>> . )
>>
>> Of course under linux, your "break" is the terminate signal,
>> aka control c. The terminate signal can be sent to your rogue
>> forth if you know its pid.
>>
>
> Which is apparently what SwiftForth on my Mac does, because it handles
> Jason's case just fine.

We just set the sigaction for a user interrupt. No pid's involved. 
Obviously handler code is supplied for what to do if.
You can also use the command dot (cmd.) keys combination, the 
traditional Apple way.

[toc] | [prev] | [next] | [standalone]


#32562

From"Elizabeth D. Rather" <erather@forth.com>
Date2014-07-22 17:11 -1000
Message-ID<-vKdnbMgWM9GulLOnZ2dnUVZ_s-dnZ2d@supernews.com>
In reply to#32550
On 7/22/14 12:04 PM, Jason Damisch wrote:
> On Tuesday, July 22, 2014 2:50:05 PM UTC-7, Roger Levy wrote:
>> Which Forth?
>
> Well any that I've tried. Or remember at the moment.  Lets see....
>
> In SwiftForth
>
> : FRED   BEGIN AGAIN ;
> FRED
>
> Makes Forth lock up, and the BREAK key does not get me out.
>
> Clicking on the red stop sign icon in the SwiftForth console does not break either.  But if I start SwiftForth and then hit the red stop sign icon before I define and run FRED then a little popup window shows up which says "Error!" in the blue bar and "Break" under that.

Try CtrlC.

Cheers,
Elizabeth

-- 
==================================================
Elizabeth D. Rather   (US & Canada)   800-55-FORTH
FORTH Inc.                         +1 310.999.6784
5959 West Century Blvd. Suite 700
Los Angeles, CA 90045
http://www.forth.com

"Forth-based products and Services for real-time
applications since 1973."
==================================================

[toc] | [prev] | [next] | [standalone]


#32576

FromJason Damisch <jasondamisch@yahoo.com>
Date2014-07-23 09:59 -0700
Message-ID<66d675fb-da66-4d6b-9460-66ccbd9ba139@googlegroups.com>
In reply to#32562
On Tuesday, July 22, 2014 8:11:23 PM UTC-7, Elizabeth D. Rather wrote:

> Try CtrlC.

I did, it didn't do anything at all.

Jason

[toc] | [prev] | [next] | [standalone]


#32551

FromDavid Schultz <abuse@127.0.0.1>
Date2014-07-22 17:47 -0500
Message-ID<MsCdnZVb9rlpdFPOnZ2dnUVZ_sqdnZ2d@earthlink.com>
In reply to#32547
On 07/22/2014 04:44 PM, Jason Damisch wrote:
> Why No Work?
> 
> http://memegenerator.net/instance/52868799
> 
> I remember in old Interpreted BASIC that when you have a run away
> program, that pressing the BREAK key would bring you back to a
> prompt.  In Forth this is not the case.  I was wondering if there was
> a reason for this besides...
> 
> Using BREAK key makes you a weakling, you should know and use the
> Forth methodology of write and test immediately.  Using BREAK
> encourages you to write large subroutines, and subroutines should be
> small.  Starting up Forth takes almost no time at all, so you can
> quickly insert a  QUIT  somewhere and run your program again.  You
> don't need BREAK.
> 
> I'm sure that BREAK works on an interrupt, so that slowing the inner
> interpreter down is not a reason.
> 
> Any thoughts on this?
> 
> Jason
> 

Break was usually sent as a special condition on the RS-232 serial
console port. Depending on the UART you may be able to detect a break
condition and generate an interrupt but that is very hardware dependent.

If you don't even have a RS-232 console connection then you have to
figure out some other way of signaling a break condition. Then you can
add a BREAK to your FORTH.

[toc] | [prev] | [next] | [standalone]


#32553

Fromrickman <gnuarm@gmail.com>
Date2014-07-22 19:12 -0400
Message-ID<lqmr4a$qbg$1@dont-email.me>
In reply to#32551
On 7/22/2014 6:47 PM, David Schultz wrote:
> On 07/22/2014 04:44 PM, Jason Damisch wrote:
>> Why No Work?
>>
>> http://memegenerator.net/instance/52868799
>>
>> I remember in old Interpreted BASIC that when you have a run away
>> program, that pressing the BREAK key would bring you back to a
>> prompt.  In Forth this is not the case.  I was wondering if there was
>> a reason for this besides...
>>
>> Using BREAK key makes you a weakling, you should know and use the
>> Forth methodology of write and test immediately.  Using BREAK
>> encourages you to write large subroutines, and subroutines should be
>> small.  Starting up Forth takes almost no time at all, so you can
>> quickly insert a  QUIT  somewhere and run your program again.  You
>> don't need BREAK.
>>
>> I'm sure that BREAK works on an interrupt, so that slowing the inner
>> interpreter down is not a reason.
>>
>> Any thoughts on this?
>>
>> Jason
>>
>
> Break was usually sent as a special condition on the RS-232 serial
> console port. Depending on the UART you may be able to detect a break
> condition and generate an interrupt but that is very hardware dependent.
>
> If you don't even have a RS-232 console connection then you have to
> figure out some other way of signaling a break condition. Then you can
> add a BREAK to your FORTH.

I was thinking the same thing, but when I looked at my computer keyboard 
I found a break key.  So it's there!

-- 

Rick

[toc] | [prev] | [next] | [standalone]


#32554

FromJason Damisch <jasondamisch@yahoo.com>
Date2014-07-22 16:21 -0700
Message-ID<8a30447d-890f-43f7-a651-580996fb404e@googlegroups.com>
In reply to#32553
On Tuesday, July 22, 2014 4:12:00 PM UTC-7, rickman wrote:

> I was thinking the same thing, but when I looked at my computer keyboard  
> I found a break key.  So it's there!

But what does it do in the Forth that you are using?

Jason

[toc] | [prev] | [next] | [standalone]


#32561

Fromrickman <gnuarm@gmail.com>
Date2014-07-22 22:51 -0400
Message-ID<lqn7v9$1sl$1@dont-email.me>
In reply to#32554
On 7/22/2014 7:21 PM, Jason Damisch wrote:
> On Tuesday, July 22, 2014 4:12:00 PM UTC-7, rickman wrote:
>
>> I was thinking the same thing, but when I looked at my computer keyboard
>> I found a break key.  So it's there!
>
> But what does it do in the Forth that you are using?
>
> Jason

Win32Forth - The title bar changes from "Win32Forth 6.15.03" to 
"Win32Forth 6.15.03 (Not Responding)".  Opps, no, that is just a matter 
of time so the break key does nothing.

Interesting because this Forth has a lot of good error checks and 
recoveries built in.  I guess they are more about address and stack 
checking.

-- 

Rick

[toc] | [prev] | [next] | [standalone]


#32568

FromMatthias Trute <matthias.trute@gmail.com>
Date2014-07-23 02:18 -0700
Message-ID<0e2cb84b-4445-4098-8ed6-e31b77b57594@googlegroups.com>
In reply to#32547
> 
> I'm sure that BREAK works on an interrupt, so that slowing the inner interpreter down is not a reason.
> 
> 
> 
> Any thoughts on this?

Does come http://amforth.sourceforge.net/TG/recipes/Debugshell.html
close to what you expect? Another way, which works as long as
the keyboard works is http://amforth.sourceforge.net/TG/recipes/Ctrl-C.html

Everything's for micros, of course. They have low level interrupt pins..

Matthias

[toc] | [prev] | [next] | [standalone]


#32571

Fromanton@mips.complang.tuwien.ac.at (Anton Ertl)
Date2014-07-23 13:21 +0000
Message-ID<2014Jul23.152159@mips.complang.tuwien.ac.at>
In reply to#32547
Jason Damisch <jasondamisch@yahoo.com> writes:
>Why No Work?

And now in English, please?

>I remember in old Interpreted BASIC that when you have a run away program, =
>that pressing the BREAK key would bring you back to a prompt.  In Forth thi=
>s is not the case.  I was wondering if there was a reason for this besides.=
>..

If I try it in Gforth in an xterm on Linux, I find that pressing or
releasing the break key is not even propagated through the xterm to
the application running on the xterm, so there is no way for Gforth to
know that you pressed the Break key (nor for any other Forth running
in the xterm).  Generally, I know of no program (even programs with an
X interface, that actually can notice when the break key is pressed)
that does anything known to me with the break key.  That's also true
for the MS-DOS programs I used 25 years ago.

The way that's used on Unix (and, I think, also frequently on Windows)
to stop console programs is Ctrl-C.  In Gforth this produces a -28
THROW (User Interrupt); likewise in SwiftForth.  In vfxlin it
terminates the Forth system.

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2014: http://www.euroforth.org/ef14/

[toc] | [prev] | [next] | [standalone]


#32578

FromJason Damisch <jasondamisch@yahoo.com>
Date2014-07-23 10:02 -0700
Message-ID<ac46958d-26c7-44c2-91e1-55c7820c203a@googlegroups.com>
In reply to#32571
On Wednesday, July 23, 2014 6:21:59 AM UTC-7, Anton Ertl wrote:
> Jason Damisch writes:
> 
> >Why No Work?
> And now in English, please?

Was Joke.

> The way that's used on Unix (and, I think, also frequently on Windows)
> to stop console programs is Ctrl-C.  In Gforth this produces a -28
> THROW (User Interrupt); likewise in SwiftForth.  In vfxlin it
> terminates the Forth system.

: FRED   BEGIN AGAIN ;
FRED
( tries Control-C and it does nothing )

Jason

[toc] | [prev] | [next] | [standalone]


#32595

FromBernd Paysan <bernd.paysan@gmx.de>
Date2014-07-24 04:10 +0200
Message-ID<lqpptr$d39$1@online.de>
In reply to#32571
Anton Ertl wrote:
> The way that's used on Unix (and, I think, also frequently on Windows)
> to stop console programs is Ctrl-C.  In Gforth this produces a -28
> THROW (User Interrupt); likewise in SwiftForth.  In vfxlin it
> terminates the Forth system.

According to MSDN, Ctrl+C and Ctrl+Break in a console send signals to the 
process.

http://msdn.microsoft.com/de-de/library/windows/desktop/ms682541(v=vs.85).aspx

SetConsoleMode can disable that.  So I'd expect a console application in 
Windows to react like on Linux, but an application with its own terminal 
window (like Win32Forth) to behave differently.

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://bernd-paysan.de/

[toc] | [prev] | [next] | [standalone]


#32585

Frommhx@iae.nl
Date2014-07-23 13:45 -0700
Message-ID<461f842c-eb2f-4cbf-a2da-74555d085a2c@googlegroups.com>
In reply to#32547
On Tuesday, July 22, 2014 11:44:38 PM UTC+2, Jason Damisch wrote:
[..]
> I'm sure that BREAK works on an interrupt, so that slowing the
> inner interpreter down is not a reason.
> 
> Any thoughts on this?

It makes the Forth very OS specific (maybe). It certainly 
is not easy to find out how to do it correctly and from
a non-C language.

-marcel

[toc] | [prev] | [next] | [standalone]


#32591

FromBruceMcF <agila61@netscape.net>
Date2014-07-23 16:37 -0700
Message-ID<f71212d2-0126-413e-897d-889b25733735@googlegroups.com>
In reply to#32547
On Tuesday, July 22, 2014 5:44:38 PM UTC-4, Jason Damisch wrote:
> I'm sure that BREAK works on an interrupt, so that slowing the inner interpreter down is not a reason.

Also, note that the BREAK key works like any other key, by sending a scancode. Whether or not there is a software interrupt triggered is more up to the operating system and keyboard driver, and there's no particular reason to expect a Windows system to do any such thing.

Since the BREAK key no longer has any definite meaning in a modern system (at least, after the OS has been loaded ... its not unusual for it to work as a pause text display key when a BIOS is operating in text mode), a Forth system is certainly free to use it to generate a software interrupt ...

... but I'd expect that people programming a Forth system with interrupts would normally want to have the interrupts work as they specify, rather than according to some system pre-set.

[toc] | [prev] | [next] | [standalone]


#32783

From"Clyde W. Phillips Jr." <cwpjr02@gmail.com>
Date2014-07-30 16:13 -0700
Message-ID<ce267131-400d-4042-8108-7719c3f403a8@googlegroups.com>
In reply to#32547
On Tuesday, July 22, 2014 4:44:38 PM UTC-5, Jason Damisch wrote:
> Why No Work?
> 
> 
> 
> http://memegenerator.net/instance/52868799
> 
> 
> 
> I remember in old Interpreted BASIC that when you have a run away program, that pressing the BREAK key would bring you back to a prompt.  In Forth this is not the case.  I was wondering if there was a reason for this besides...
> 
> 
> 
> Using BREAK key makes you a weakling, you should know and use the Forth methodology of write and test immediately.  Using BREAK encourages you to write large subroutines, and subroutines should be small.  Starting up Forth takes almost no time at all, so you can quickly insert a  QUIT  somewhere and run your program again.  You don't need BREAK. 
> 
> 
> 
> I'm sure that BREAK works on an interrupt, so that slowing the inner interpreter down is not a reason.
> 
> 
> 
> Any thoughts on this?
> 
> 
> 
> Jason

: FRED BEGIN DO_WHATEVER ?TERMINAL UNTIL ;

[toc] | [prev] | [next] | [standalone]


#32786

Fromfrancois.ganza@wanadoo.fr
Date2014-07-30 22:55 -0700
Message-ID<d4734d01-3fc4-495c-a6b8-343ed78bc529@googlegroups.com>
In reply to#32547
Bonjour,

Je programme de petites applications, et je n'aimerais pas que l'utilisateur
puisse bloquer le programme ou avoir accès à certains mots juste parce-qu'il a
appuyé sur Ctrl-C ...

Si vous voulez pouvoir stopper un programme pendant sa période de test, il faut
simplement prévoir un mot pour ça, comme par exemple :

: BREAK? ( --- )
  KEY? IF
    KEY 27 = ABORT" BREAK!"
   THEN ;

votre programme deviendrait donc

: FRED BEGIN BREAK? AGAIN ;

cordialement,
François

[toc] | [prev] | [standalone]


Page 5 of 5 — ← Prev page 1 2 3 4 [5]

Back to top | Article view | comp.lang.forth


csiph-web