Why not try, IsArray(Session[myvar])?
Don't forget that Session is a struct, so, you can use [] notation to access
values.
As a general comment, and this isn't to you Costas, I see _way_ too many
people who forget that they can easily access values in structs, even
dynamic values, by using brackets. I see _way_ too many people use evaluate
instead, which is not the fastest or best solution.
If you have a dynamic key in a structure, you can get the value like so:
<CFSET KEY = "Set by some other thing">
<CFSET Val = TheStruct[Key]>
Do that instead of... <CFSET VAL = Evaluate("TheStruct." & KEY)>
Just a tip. :)
=======================================================================
Raymond Camden, Principal Spectra Compliance Engineer for Macromedia
Email : [EMAIL PROTECTED]
Yahoo IM : morpheus
"My ally is the Force, and a powerful ally it is." - Yoda
> -----Original Message-----
> From: Costas Piliotis [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 30, 2001 2:32 PM
> To: CF-Talk
> Subject: isArray function and Dynamic Variables
>
>
> Alright. I'm stumped. Our application uses session variables, and I'm
> trying to bridge the gap with CF and ASP through client variables
> stored in
> the database - I'll loop through them in my global.asa file to parse them
> out. I have a script here that converts session to client
> variables, but I
> have an array as a with a session scope, which cannot be converted to a
> client variable. Don't really need the array as a client
> variable anyways,
> so I'd like to skip over it.
>
> Here's the problem. I loop through session variables, and I get
> myVar. I'd
> like to use the isArray function, but I can't use quotes around
> the variable
> name in the isArray function.
>
> I've also tried using cftry, but that fails as well.
>
> Anyone got any ideas here's a copy of the code. The second line
> is the one
> being a pain...?
>
> <cfloop collection="#session#" item="myVar">
> <cfif not isArray("session." & "#myvar#")>
> <cfset "CLIENT.SESSION.#myVar#" = #evaluate("session." &
> "#myvar#")#>
> </cfif>
> </cfloop>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists