home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.os.vms      DEC's VAX* line of computers & VMS.      264,096 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 262,322 of 264,096   
   Lawrence D'Oliveiro to All   
   Re: basic BASIC question   
   02 Feb 25 00:35:48   
   
   From: ldo@nz.invalid   
      
   On Fri, 31 Jan 2025 10:18:00 -0500, Arne Vajhøj wrote:   
      
   > Is it common to use:   
   >   
   > declare integer constant TRUE = -1   
   > declare integer constant FALSE = 0   
   >   
   >   
   > ?   
      
   I can remember on the Motorola 68000, false was 0 (all bits clear) and   
   true was -1 (all bits set). Being a Pascal fan at the time, I thought this   
   was really a bad idea. In Pascal you have the equivalant of   
      
       type   
           boolean = (false, true);   
      
   so false clearly maps to 0 and true to 1.   
      
   Why is it important to insist on this? So that you can use boolean, like   
   any other discrete type, as an array index type. E.g.   
      
       var   
           double_buffer : array [boolean] of buffer;   
           thisbuf : boolean;   
      
   Glad to see that C99 sort-of agrees with Pascal. Certainly it says the   
   only *defined* values of bool type are 0 for false and 1 for true.   
      
   --- SoupGate-DOS v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca