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 / 548
547  |  549
Subject: 
Re: Breaking from infinite loops
Newsgroups: 
lugnet.robotics.rcx.pbforth
Date: 
Tue, 16 Jul 2002 10:06:31 GMT
Viewed: 
2528 times
  
In lugnet.robotics.rcx.pbforth, Matt Jadud writes:
I need a way to get out of a user program that intentionally defines an
infinite loop.


Hi,

if you just want to stop your "own" program use the Forth word ABORT or ABORT"

: TEST
  1000 0 DO
    \ do something
    run-button-down?
    ABORT" Aborted by user!"
  LOOP
;

or if you want what looks like a "reset" use COLD:

run-button-down? IF
  POWER_OFF
  COLD      \ do a "reset" after powered on again
THEN

Note that you cannot abort a running program from the UserISR this way.
(That is what the other thread you mentioned deals with)

Greetings,
Alex



Message is in Reply To:
  Breaking from infinite loops
 
This feels vaguely similar to a question just recently posed, almost. I need a way to get out of a user program that intentionally defines an infinite loop. My best attempt so far at an exit word : exit POWER_OFF LCD_4TH LCD_REFRESH ; in the context (...) (22 years ago, 16-Jul-02, to lugnet.robotics.rcx.pbforth)

2 Messages in This Thread:

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

Custom Search

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