> Yes, but it's always good to have an internal sanity check before
> immediately diving into using listXxx() functions on strings... I see
> a lot of listGetAt() calls in code and that function is almost never
> the right way to do things!
This function is a nice blend of cf and java, i've only test this on cf7
though should be fine on cf6.1
<cfset myFile="foo.js">
<cfscript>
i = myFile.lastIndexOf('.');
if (i gt 0) {
fileType = myFile.substring(incrementvalue(i));
} else {
fileType = '';
}
</cfscript>
<cfoutput>#filetype#</cfoutput>
It is very frustrating though that the cf function incrementvalue() does
return a int data type but something like i+1 returns a double. If you
replace the incrementvalue(i) function with i+1 in the substring call the
code fails because the java substring function requires an int to be
passed.
again my $.02
rod
---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/