> -----Original Message----- > From: Bobby Hartsfield [mailto:[EMAIL PROTECTED] > Sent: Sunday, September 25, 2005 2:57 PM > To: CF-Talk > Subject: RE: Best way of determining CF Datatypes > > > Really... never noticed. ;^) > > Hehe. Like I said... I just woke up and didn't even see the name of the > person who asked the question (else I wouldn't have pointed out the > obvious > to you ;^) > > I guess BEST method depends on WHAT you're doing, WHY you're doing it and > any specifics on HOW you need to do it.
I actually (finally) doing my YODEL parser in CF. Information about that is here: http://www.depressedpress.com/Content/Development/YODEL/Index.cfm > How exact the types need to be is one (if not THE) consideration. I mean > are > dates, numbers and/or strings enough or are you going to be needing more > in > depth types Not much - YODEL is pretty simplistic when it comes to this: "object", "array", "null", "undefined", "string", "number", "boolean", "date", or "binary". I think, considering that: "object": Simple, this is a struct. "array": Simple, this is an array. "null": Not so simple. Either it won't be used in CF at all or I could have a parameter that converts empty strings to null. "undefined": Simple, not used in CF. "binary": Simple, "isBinary" is determinant. "date": Simple? I think I'll be able to come up with a way to determine if a value is a "real" date object or not (WDDX does this now... internally at least). Any ideas would be appreciated. "boolean": This one is troublesome... YODEL declares that "true", "false", "1" and zero are all "Boolean" values - but obviously they may also be numbers or strings in CF. "number": Numbers can be numbers OR strings in CF. That may cause problems (for example a query column might be "string" but have number values). "string": This one is pretty easy as well: anything that's not something else is a string. So in the end I think my "troublemakers" will be Numbers and Booleans. > TO decide the types in CF before passing them out to another language > (which > I'd assume was the BEST way to write this) you (obviously) will be stuck > with mainly the is*() functions. Which kind of blows because there aren't > that many of them. There are enough - they're just not completely determinant. Any Boolean value is a string, as is any number (there's no "isString()" function - just "isSimpleValue()") It's hard to tell in CF whether "1" is a string containing a digit, a number or a Boolean: isNumeric, isSimpleValue and isBoolean all return "True". ;^) > Of course none of this is an answer or solution to what you've asked; it's > simply a post-breakfast response. I'll of course see what I can dig up. Well... I don't think there's going to be a simple solution... but being forced to talk it through is helping a lot. Thanks! Jim Davis ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:219207 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

