Variant Record

  • Jonathan Marchand

    How can I document a Variant Record like this one:

    TEmployee = record
      FirstName, LastName: string[40];
      BirthDate: TDate;
      case Salaried: Boolean of
        True: (AnnualSalary: Currency);
        False: (HourlyWage: Currency);


    • Darren Bowles

      Darren Bowles - 2004-01-18

      The short answer is that variant records aren't well handled at the moment, certainly the case statement if throwing things off, because pas2dox has no idea how to convert those statements to a c++ style syntax that doxygen would handle.

      The closest match that could be documented would be something like the following :

      /// Employee details
      TEmployee = record
        FirstName : String;    ///< First Name
        Lastname : string;    ///< Last Name
        BirthDate: TDate;    ///< Date Of Birth
        Salaried : Boolean;     ///< Salary Type
                          ///<  \li true - Annual Salary
                        ///<  \li false - Hourly Wage



Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks