Ron, try this.

<cfset the_VarName="test">
<cfset startingPosition = 1>

<cfset application[the_VarName] = arrayNew(2)>
<cfset application[the_VarName][startingPosition][1] = structnew()>



On 11/11/05, Ron Mast <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I was just trying to figure this out and I get an error and I don't know
> the work around can anyone show me how I can do this the correct way?
>
>
>
> <cfset the_VarName = "test">
>
> <cfset startingPosition = 1>
>
>
>
> <cfset "application.#the_VarName#" = arrayNew(2)>
>
> <cfset the_VarNameWPos = the_VarName & "[" & startingPosition & "][1]">
>
> <cfset "application.#the_VarNameWPos#" = structNew()>
>
>
>
> I'm guessing that "[]" is causing the problem.  The error I get is:
>
>
> The string "application.test[1][1]" is not a valid ColdFusion variable
> name.
>
>
> Valid variable names must start with a letter, and can only contain
> letter, numbers, and underscores.
>
>
>
>
>
> The error occurred in E:\wwwroot\codeTests\cfc\descriptiveArray.cfm:
> line 9
>
> 7 : <cfset "application.#the_VarName#" = arrayNew(2)>
> 8 : <cfset the_VarNameWPos = the_VarName & "[" & startingPosition &
> "][1]">
> 9 : <cfset "application.#the_VarNameWPos#" = structNew()>
> 10 : <!--- <cfset application.the_VarName[1][1].name = "Ron">
> 11 : <cfset application.the_VarName[1][2] = structNew()>
>
>
>
>
>
> Thanks in advance,
>
>
>
>
>
> Ron Mast
>
> Webmaster
>
> Truth Hardware
>
> Ph: 507-444-4748
>
> Fx: 507-444-5361
>
> www.truth.com
>
>
>
>
> _______________________
> This e-mail and any files transmitted with it are confidential and are 
> intended solely for the use of the individual to whom they are addressed.  If 
> you are not the intended recipient or the individual responsible for 
> delivering the e-mail to the intended recipient, please be advised that you 
> have received this e-mail in error and that any use, dissemination, 
> forwarding, printing, or copying of this e-mail is strictly prohibited.
>
> _______________________________________________
> List mailing list
> Reply to DFWCFUG:
> [email protected]
> Subscribe/Unsubscribe:
> http://lists1.safesecureweb.com/mailman/listinfo/list
> List Archive:
> http://lists1.safesecureweb.com/mailman/private/list
>


--
Marlon

"And I have no religion and I don't know what's what
And I don't know the limit, the limit of what we got"

_______________________________________________
List mailing list
Reply to DFWCFUG:
[email protected]
Subscribe/Unsubscribe:
http://lists1.safesecureweb.com/mailman/listinfo/list
List Archive:
http://lists1.safesecureweb.com/mailman/private/list

Reply via email to