DelphiBasics
TConvFamily
Variable
Defines a family of measurement types as used by Convert ConvUtils unit
var
  cbArea : TConvFamily;
  cbDistance : TConvFamily;
  cbMass : TConvFamily;
  cbTemperature : TConvFamily;
  cbTime : TConvFamily;
  cbVolume : TConvFamily;
Description
The TConvFamily variables are families of measurement types used by the powerful and useful Convert measurement utility.
 
Convert can convert a measurement from one type in a TConvFamily to another in the same family.
 
It can also convert complex measurements, such as miles per gallon.
 
The family contents are listed here:
 
cbArea family
 
  auSquareMillimeters
  auSquareCentimeters
  auSquareDecimeters
  auSquareMeters
  auSquareDecameters
  auSquareHectometers
  auSquareKilometers
  auSquareInches
  auSquareFeet
  auSquareYards
  auSquareMiles
  auAcres
  auCentares
  auAres
  auHectares
  auSquareRods

 
cbDistance family
 
  duMicromicrons
  duAngstroms
  duMillimicrons
  duMicrons
  duMillimeters
  duCentimeters
  duDecimeters
  duMeters
  duDecameters
  duHectometers
  duKilometers
  duMegameters
  duGigameters
  duInches
  duFeet
  duYards
  duMiles
  duNauticalMiles
  duAstronomicalUnits
  duLightYears
  duParsecs
  duCubits
  duFathoms
  duFurlongs
  duHands
  duPaces
  duRods
  duChains
  duLinks
  duPicas
  duPoints

 
cbMass family
 
  muNanograms
  muMicrograms
  muMilligrams
  muCentigrams
  muDecigrams
  muGrams
  muDecagrams
  muHectograms
  muKilograms
  muMetricTons
  muDrams
  muGrains
  muLongTons
  muTons
  muOunces
  muPounds
  muStones

 
cbTemperature family
 
  tuCelsius
  tuKelvin
  tuFahrenheit
  tuRankine
  tuReamur

 
cbTime family
 
  tuMilliSeconds
  tuSeconds
  tuMinutes
  tuHours
  tuDays
  tuWeeks
  tuFortnights
  tuMonths
  tuYears
  tuDecades
  tuCenturies
  tuMillennia
  tuDateTime
  tuJulianDate
  tuModifiedJulianDate

 
cbVolume family
 
  vuCubicMillimeters
  vuCubicCentimeters
  vuCubicDecimeters
  vuCubicMeters
  vuCubicDecameters
  vuCubicHectometers
  vuCubicKilometers
  vuCubicInches
  vuCubicFeet
  vuCubicYards
  vuCubicMiles
  vuMilliLiters
  vuCentiLiters
  vuDeciLiters
  vuLiters
  vuDecaLiters
  vuHectoLiters
  vuKiloLiters
  vuAcreFeet
  vuAcreInches
  vuCords
  vuCordFeet
  vuDecisteres
  vuSteres
  vuDecasteres
  vuFluidGallons
  vuFluidQuarts
  vuFluidPints
  vuFluidCups
  vuFluidGills
  vuFluidOunces
  vuFluidTablespoons
  vuFluidTeaspoons
  vuDryGallons
  vuDryQuarts
  vuDryPints
  vuDryPecks
  vuDryBuckets
  vuDryBushels
  vuUKGallons
  vuUKPottles
  vuUKQuarts
  vuUKPints
  vuUKGills
  vuUKOunces
  vuUKPecks
  vuUKBuckets
  vuUKBushels
Related commands
ConvertConvert one measurement value to another
TConvTypeDefines a measurement type as used by Convert
 Download this web site as a Windows program.




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

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

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

  // Display both values
  ShowMessageFmt('%f UK gallons = %f litres',[gallons, litres]);
end;
Show full unit code
  1.00 UK gallons = 4.55 litres
 
Example code : Convert miles per gallon to kilometres per litre
var
  milesPerGallon, kilometresPerLitre : Double;

begin
  // We have a very efficient car
  milesPerGallon := 58.5;

  // Convert to kilometres per litre
  kilometresPerLitre := Convert(milesPerGallon,
                                duMiles,
                                vuUKGallons,
                                duKilometers,
                                vuLiters);

  // Display both values
  ShowMessageFmt('%f UK miles per gallon = %f km per litre',
                 [milesPerGallon, kilometresPerLitre]);
end;
Show full unit code
  58.5 UK miles per gallon = 20.71 km per litre
 
Delphi Programming © Neil Moffatt . All rights reserved.  |  Home Page