debug skill : how to continue a halt ?

Discussion in 'Rebol' started by HCCHEN, Mar 20, 2011.

  1. HCCHEN

    HCCHEN New Member

    I hope it's good for debug by putting some 'halt' in program. Like a break point.
    So I can check anything I want at those points by the console interactively.

    But, how to continue?
  2. Graham

    Graham Developer Staff Member

    You can't continue from a halt.
  3. HCCHEN

    HCCHEN New Member

    Thanks.
    If 'halt' is not suitable to play the role as a 'break point' then is there a correct way ?
  4. Graham

    Graham Developer Staff Member

    just print the values you want at the point you want
  5. Sunanda

    Sunanda New Member

    Try this home-grown PAUSE function:
    Code:
    pause: func [text /local input][
      input: "none"
      while ["" <> trim/lines input][
      input: ask join text " >> "
      attempt [probe do input]
      ]
    ]
      
    
    ;; examples of use:
      
    aa: 11
    bb: 22
    pause "first check"
    cc: aa + bb
    pause "second check"
    
  6. HCCHEN

    HCCHEN New Member

    Wow, very short very simple , press <enter> to continue. 5 stars !!!
  7. swhite

    swhite Member

    Thanks from me also for that little "pause" function.

    After my latest REBOL episode of struggling to finally understand the scroller, and then promptly forgetting it, I have started to capture these bits of knowledge of REBOL into heavily-annotated functions that I keep in my personal library. I'll write a paragraph of comments per line of code if I have to, just so I don't forget how it all works. I should get the "pause" function in there today.

Share This Page