|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
UDF Problem
Using CF5. I pull two float columns (prices) from a table and then passJim McAtee 05/25/04 05:10 P Can you show us how you are calling the UDF?Raymond Camden 05/25/04 05:48 P Try calling the function like this:Ben Doom 05/25/04 05:50 P Original Message:Scott Brady 05/25/04 05:49 P > Original Message:Jim McAtee 05/25/04 06:05 P Using CF5. I pull two float columns (prices) from a table and then pass the values to a CF function, shown below: function PriceRangeFormat(pricelo, pricehi) { return DollarFormat(pricelo) & " - " & DollarFormat(pricehi); } I receive the following error, no matter the values passed: >> Parameter 1 of function DollarFormat must be a basic value, i.e., a >> string, number, logical, or date/time value But I can call DollarFormat() directly on the values without error. It's only when I pass them into the CF function that I get the error. All rows in this table contain numbers in the two fields, from 0.0 to maybe 2000.0. No null values. #DollarFormat(pricelo)# - #DollarFormat(pricehi)# What am I missing? Can you show us how you are calling the UDF? Try calling the function like this: priceRangeFormat(pricelo[1], pricehi[1]); Just a guess, though. --Ben Doom Jim McAtee wrote: ----- Excess quoted text cut - see Original Post for more ----- Original Message: > From: "Jim McAtee" > But I can call DollarFormat() directly on the values without error. It's > only when I pass them into the CF function that I get the error. All rows > in this table contain numbers in the two fields, from 0.0 to maybe 2000.0. > No null values. > > #DollarFormat(pricelo)# - #DollarFormat(pricehi)# Can you post the code that actually calls your UDF? Based on the error, it sounds like you're trying to pass a complex variable (array, recordset, structure, etc.) to the UDF instead of the simple values. Scott --------------------------- Scott Brady http://www.scottbrady.net/ > Original Message: > > From: "Jim McAtee" > > But I can call DollarFormat() directly on the values without error. It's > > only when I pass them into the CF function that I get the error. All rows > > in this table contain numbers in the two fields, from 0.0 to maybe 2000.0. ----- Excess quoted text cut - see Original Post for more ----- recordset, > structure, etc.) to the UDF instead of the simple values. Found it. Sheesh. 'r' is the name of the query, so the function call itself wasn't crapping out. #PriceRangeFormat(r.PriceLo, r,PriceHi)# :-)
|
May 24, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||