Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with conversions for culinary terms

Status
Not open for further replies.

helenegarr

Technical User
Jan 6, 2003
1
US
Is there a place that I could add culinary measurements to the expression builder or is there and add-in that I could download some were?
 
You can best build a CulMeasures, e.g.,module with public functions defined for each expected conversion. I assume you want to relate culinary measures to each other, e.g., teaspoons in a tablespoon, cups in a pint, etc., although you can do the same thing to convert grams to ounces, fluid ounces to cups, and like that. Sample code follows:

Public Function PintsFromCups(byval varCups as Variant) as Variant
PintsFromCups=nz(varCups)/2
End Function

Of course, you can sex this up some, using a single function and optional parameter sets, or a key word to specify the conversion set, but I think functions named like the behave make it easier to use them in real life.
 
A common approach is to just build a table "FromUnits"; "ToUnits"; "ConvRate". Then the process becomes just a look-up and simple single expression. I know of no already built table for cooking units, but there are numerous static (print) examples for the data and the look up & conversion Function should be trivial.

MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top