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

Re: Run-time stack balance verification

From: Charles Melice <mail_at_forthcad.com>
Date: Sat, 18 Dec 1999 13:40:29 +0100

Rick,

This is exactly what I wanted to have !

> Charles,
> The following code will implement a simple version of your requirements.
> You might need to pretty it up a bit, add a few features.
> Hope it helps,
> Rick

I have already found and corrected 2 unbalanced situations using your
system.

This is usefull to check a master word or Window message, and if there is a
problem, to use your balance checker to verify composant words (using the
following on/off system).

    0 VALUE (CHECK-BALANCE)

    : SBAL-ON ( -- ) TRUE TO (CHECK-BALANCE)
        STATE @ ABORT" not in definition" ; IMMEDIATE

    : SBAL-OFF ( -- ) FALSE TO (CHECK-BALANCE)
        STATE @ ABORT" not in definition" ; IMMEDIATE

    : (
       STATE @ IF FIRST? (CHECK-BALANCE) AND IF ...
       ...

I don't know how many hours I have already saved, possibly days.

Great Thank you,
Charles

.
Received on Sat Dec 18 1999 - 13:40:29 PST

This archive was generated by hypermail 2.2.0 : Thu Nov 20 2008 - 03:04:26 PST