DelphiBasics
TConvType
Type
Defines a measurement type as used by Convert ConvUtils unit
type TConvType = type Word;
Description
The TConvType type defines a measurement type used in the Convert general purpose conversion utility.
 
The type should be assigned from one of the TConvFamily values. (See TConvFamily for available values).
Related commands
ConvertConvert one measurement value to another
TConvFamilyDefines a family of measurement types as used by Convert
 Download this web site as a Windows program.




 
Example code : Convert UK gallons to litres
var
  gallons, litres  : Double;
  fromType, toType : TConvType;

begin
  // Define the gallons value
  gallons := 1;

  // Convert to litres
  fromType := vuUKGallons;
  toType   := vuLiters;
  litres := Convert(gallons, fromType, toType);

  // Display both values
  ShowMessageFmt('%f UK gallons = %f litres',[gallons, litres]);
end;
Show full unit code
  1.00 UK gallons = 4.55 litres
 
Delphi Programming © Neil Moffatt . All rights reserved.  |  Home Page