home bbs files messages ]

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

   comp.lang.pascal.borland      Borland Pascal was actually pretty neat      2,978 messages   

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

   Message 1,416 of 2,978   
   Dr John Stockton to All   
   Re: Infinite Loops & other things   
   21 Feb 05 22:46:58   
   
   From: spam@merlyn.demon.co.uk   
      
   JRS:  In article , dated Mon, 21 Feb   
   2005 17:06:07, seen in news:comp.lang.pascal.borland, Dr Engelbert   
   Buxbaum  posted :   
   >   
   >> One other note that appears to be unique to Pascal apparently:   
   >> True  = 1   
   >> False = 0   
   >> Boolean expressions (of various word-sizes too!) ALL evaluate to 0 or 1   
   >> !!   
   >   
   >Nope, these statements are illegal. True and false are reserved words   
   >(ie can not be reassigned) and are boolean caonstants.   
      
      
   That is a terminological inexactitude.   
      
   In BP7, and in Delphi 3,   
           const   
           true : boolean = false ;   
           false : boolean = 2<>3 ;   
           begin Writeln(true:6, false:6) ;   
           end.   
      
   gives   FALSE  TRUE   
      
      
           type boolean = (true, uncertain, false) ;   
           begin Writeln(Ord(true):6, Ord(false):6) ;   
           end.   
      
   gives        0     2   
      
   But     true := ... ; will not compile using native true; OTOH   
      
           var true, false : boolean ;   
           begin   
           true := 1=2 ; false := 1=1 ;   
           Writeln(true:6, false:6) ;   
           end.   
      
   gives   FALSE  TRUE   
      
      
           type integer = 6..9 ;   
           var X : integer ;   
           begin   
           X := 17 ;   
           end.   
      
   the assignment will not compile; but    X := 17-10 ;    will.   
      
      
      
   The wise programmer, however, will not redefine predefined items.   
      
   --   
    © John Stockton, Surrey, UK.  ?@merlyn.demon.co.uk   Turnpike v4.00   MIME. ©   
      TP/BP/Delphi/&c., FAQqy topics & links;   
        RAH Prins : c.l.p.b mFAQ;   
      Timo Salmi's Turbo Pascal FAQ.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

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


(c) 1994,  bbs@darkrealms.ca