Delphi Examples: DbiGetSysVersion

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

Delphi Examples: DbiGetSysVersion

Return to chapter overview

Get BDE system version information. This function can return the SYSVersion structure or clear and add the information to the SysVerList TStringList. If nil is passed in, only the SYSVersion structure is returned. This example uses the following input:

 Ver := fDbiGetSysVersion(MyList);

 

The function is:

function fDbiGetSysVersion(SysVerList: TStringList): SYSVersion;

var

 Month, Day, iHour, iMin, iSec: Word;

 Year: SmallInt;

begin

 Check(DbiGetSysVersion(Result));

if (SysVerList <> nil) then begin

  with SysVerList do begin

     Clear;

     Add(Format('ENGINE VERSION=%d', [Result.iVersion]));

     Add(Format('INTERFACE LEVEL=%d', [Result.iIntfLevel]));

     Check(DbiDateDecode(Result.dateVer, Month, Day, Year));

     Add(Format('VERSION DATE=%s', [DateToStr(EncodeDate(Year, Month,

       Day))]));

     Check(DbiTimeDecode(Result.timeVer, iHour, iMin, iSec));

     Add(Format('VERSION TIME=%s', [TimeToStr(EncodeTime(iHour, iMin,

       iSec div 1000, iSec div 100))]));

  end;

end;

end;