title: Usage of pascal variant record
body: <p>I need help from those who know the pascal very well.</p>
  
  <p>I need (teachers requirement) to use a variant record. Those variant record are defined like this:</p>
  
  <pre><code>Temperature = record
     case scale :   TemperatureScale of
     celsius : (celsius_value : ScaleCelsius);
     kelvin : (kelvin_value : ScaleKelvin);
  end;
  </code></pre>
  
  <p>According to primary sources I found during my research about this topic, I could not find how to use variant record, only how to declare it.</p>
  
  <p>My primary sources: google search(found nothing), <a href="http://wiki.freepascal.org/Case" rel="nofollow noreferrer">Case-Freepascal</a> and <a href="http://wiki.freepascal.org/Record" rel="nofollow noreferrer">Record-Freepascal</a></p>
  
  <p>Edit for those who wonder what i  must use in implementation it is exacly this:</p>
  
  <pre><code> type
    UkPolozka = ^Polozka;
    UkHodnota = ^Hodnota;
    TypUdaj=(typretez, typcele, typrealne, typlogik, typpole, typobjekt);
  
    VarZaznam = record
    case Udaj: TypUdaj of        
      typretez:  (retez: string);
      typcele:   (cele: word);
      typrealne: (realne: single);
      typlogik:  (logik: boolean);
      typpole:   (pole: UkHodnota);
      typobjekt: (objekt: UkPolozka);
   end;
  
   Polozka = record
      Nazev: string;
      Hodn:  VarZaznam;
      Dalsi: UkPolozka
   end;
   Hodnota = record
      Hodn:  VarZaznam;
      Dalsi: UkHodnota     
   end;
  </code></pre>