From: marcov@stack.nl   
      
   On 2005-02-03, RadSurfer wrote:   
   > What am I misisng here:   
   >   
   > if ( a and b ) then { do something } { Error: Boolean Expected! }   
   >   
   > if ((a and b) <> 0) then { do something } { AOK, allowed, Boolean   
   > result }   
   >   
   > Sheesh! I know of no other language that has this distinction.   
      
   Nearly all. The first construct is a typical C one.   
      
   > What am I missing here?   
      
   Seems that while Basic copied most things that made it compilable from Pascal,   
   they copied this from C.   
      
   > Also, like QB and VBfDos, I notice that apparently no attempt to   
   > distinquish   
   > between signed and unsigned is done; and yes usually there are various   
   > work-arounds; but its a pain to have to convert.   
      
   It's called strongtyped. This allows to check for ranges. Add {$R+} to your   
   source and see what happens. Under Modula2 you even have to cast signed   
   integers.   
      
   This kind of safety helps creating error free large programs, something Basic   
   wasn't good at. With large programs, debugging costs a lot of time, much more   
   that typing a typecast here and there.   
      
   > to use GetMem, I 1st declare a "pointer" (whatever that really means),   
   >   
   > BlockPtr: pointer;   
   >   
   > getmem(BlockPtr, AmountRam);   
   >   
   > What exactly is this "pointer" ? A far* that is 24-some-bits, or   
   > what?   
      
   It is a 16-bit compiler, so a 32-bit value that exists out of a 16-bit segment   
   and a 16-bit offset that together span a 1MB+64k-16 bytes large space.   
      
   The formular for the EA=16*segment+offset.   
      
   > If is possible to convert/treat this "pointer" as a purely integer   
   > value ?   
      
   No. Integer is 16-bit. Longint is 32-bit, but this is no use, since due   
   to the above formula, you can't add arbitrary numbers to it.   
      
   > Is type-casting ever done in TPascal ?   
      
   Yes. But typically not with pointers. For that you need a flat memory model.   
   This is a problem of it being 16-bit.   
      
   > Quite the challenge me thinks.... :-)   
      
   I wonder why you would want to torture yourself with something like TP5.5.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|