From: invalid@invalid.invalid   
      
   "F Verbeek" schrieb im Newsbeitrag   
   news:1172jqqslb5ha14@corp.supernews.com...   
   > In the obscure news:1114489845.775653.225270@f14g2000cwb.googlegroups.com,   
   > Someone calling himself Sm704   
   > suspiciously hiding as uttered:   
   >> I see a lot of source code that use functions like WORD() or   
   >> LONGINT(), but I have never seen this documented.   
   ...   
   >> number := 115200;   
   >> writeln('Without Word(): ', number);   
   >> write('With Word(): ', word(number));   
   ...   
   >> Is using longint() and word() common practice? I hardly ever see it   
   >> used...   
   > As others explained this is called type casting.   
   > You force the compiler to interpret the denoted bytes between the ()   
   > brackets as the specified type.   
   >   
   > --   
   > Femme Verbeek   
      
   var   
   a, b: word;   
   l : LongInt;   
      
   a := 30000;   
   b := 30000;   
   l := a * b;   
   writeln(l);   
   /*   
   The intermediate result is an overflow in word!   
   l will be 59648.   
   This is the way to avoid that:   
   */   
   l := longint(a) * b;   
   writeln(l);   
      
   /*   
   l will be 900000000.   
   */   
   l := word(l);   
   writeln(l);   
   /*   
   will cut of the upper 16 bits.   
   l will be 59648.   
   */   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|