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


Groups > comp.sys.acorn.programmer > #613

Re: Can anyone spot why this menu doesn't change anything please.

From Martin <News03@avisoft.f9.co.uk>
Subject Re: Can anyone spot why this menu doesn't change anything please.
Newsgroups comp.sys.acorn.programmer
Date 2011-08-14 10:54 +0100
Message-ID <5202921b82News03@avisoft.f9.co.uk> (permalink)
References <b23406a1-d5de-42a9-8904-ae0fcdc5b8ab@s7g2000yqk.googlegroups.com>
Organization None

Show all headers | View raw


If you change the code in Glue to add just three debugging statements ...

 REM Toggle a bit in a given bitmask.
 DEFPROCdev_togglebit(pos%,RETURN mask%)
   *Report "Toggle" ~mask% pos%
   IF FNdev_tstbit(pos%,mask%) THEN
     mask%=mask% OR (0<<pos%)
     *Report "True " ~mask%
   ELSE
     mask%=mask% OR (1<<pos%)
     *Report "False" ~mask%
   ENDIF
 ENDPROC

you will immediately see that all is not well, as mask% never changes.

A moments contemplation and you will realise 'mask% OR (0<<pos%)' does
NOT set a bit off!

An exellent example of why you need to see what IS happening, rather than
what you expect to happen.

<plug type=shameless>

Use Reporter!

Tip: If you run your single-tasking program in a Task Window, you can see
the Reporter information as it happens. And the source.

</plug>

Yes, you can also just use PRINT ~mask%, but it can mess up your output,
and is not so easy to identify to remove after debugging.

Martin

-- 
Martin Avison 
Note that unfortunately this email address will become invalid
without notice if (when) any spam is received. 

Back to comp.sys.acorn.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Can anyone spot why this menu doesn't change anything please. Gazza <usenet@garethlock.com> - 2011-08-13 07:01 -0700
  Re: Can anyone spot why this menu doesn't change anything please. Martin <News03@avisoft.f9.co.uk> - 2011-08-13 16:18 +0100
    Re: Can anyone spot why this menu doesn't change anything please. Gazza <usenet@garethlock.com> - 2011-08-13 09:47 -0700
      Re: Can anyone spot why this menu doesn't change anything please. Gazza <usenet@garethlock.com> - 2011-08-13 11:41 -0700
        Re: Can anyone spot why this menu doesn't change anything please. Martin <News03@avisoft.f9.co.uk> - 2011-08-13 23:35 +0100
          Re: Can anyone spot why this menu doesn't change anything please. Gazza <usenet@garethlock.com> - 2011-08-13 15:45 -0700
            Re: Can anyone spot why this menu doesn't change anything please. Martin <News03@avisoft.f9.co.uk> - 2011-08-14 10:54 +0100
              Re: Can anyone spot why this menu doesn't change anything please. Gazza <usenet@garethlock.com> - 2011-08-14 04:27 -0700
                Re: Can anyone spot why this menu doesn't change anything please. Martin <News03@avisoft.f9.co.uk> - 2011-08-14 12:43 +0100
                Re: Can anyone spot why this menu doesn't change anything please. Martin Bazley <martin.bazley@blueyonder.co.uk> - 2011-08-14 14:18 +0100
                Re: Can anyone spot why this menu doesn't change anything please. Martin <News03@avisoft.f9.co.uk> - 2011-08-14 15:24 +0100
                Re: Can anyone spot why this menu doesn't change anything please. "Barry Allen (news)" <evanallen@onetel.net.uk.invalid> - 2011-08-14 15:48 +0100
                Re: Can anyone spot why this menu doesn't change anything please. Gazza <usenet@garethlock.com> - 2011-08-14 08:46 -0700
                Re: Can anyone spot why this menu doesn't change anything please. Alan Wrigley <spamhater@keepyourfilthyspamtoyourself.co.uk> - 2011-08-14 18:36 +0100
                Re: Can anyone spot why this menu doesn't change anything please. Gazza <usenet@garethlock.com> - 2011-08-21 02:50 -0700
  Re: Can anyone spot why this menu doesn't change anything please. Martin Bazley <martin.bazley@blueyonder.co.uk> - 2011-08-13 18:00 +0100

csiph-web