Thanks for reply


To clarify:


Your saying that a reference to an array is not a valid variable name?


isdefined("QGetProjects.PROJ_NAME[#R#]")


but a Structure is:


because this works:


isDefined("session.tdy.#controller#")  

guess I am just missing something, sense CF processes arrays else were fine:


<CFOUTPUT>
    #MYArray[2]#   
</CFOUTPUT>


and you can use arrays in other functions:


DateCompare(session.tdy[controller][newrecord],form.arrdate)


I know that the DateCompare is looking at the value in the array element and
isdefined is looking for the element name itself.


But to me this seems to be inconsistent,  IF CF can tell me the value of the
array element then it should be able to tell me if its been defined?
Or am I way off?


Thanks
Rodney

-----Original Message-----
From: Barney Boisvert [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 03, 2004 4:11 PM
To: CF-Talk
Subject: RE: Isdefined Issue

The string passed to isDefined must be a syntactically valid variable name,
which your name is not.  It's the array dereference that's causing you
problems.  You can use this code instead:

<CFIF arrayLen(QGetProjects.PROJ_NAME) GTE records + 1 and
(QGetProjects.PROJ_NAME[Records] EQ QGetProjects.PROJ_NAME[Records+1])>

Cheers,
barneyb

> -----Original Message-----
> From: Bruce, Rodney S HQISEC/Veridian IT Services
> [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 03, 2004 3:03 PM
> To: CF-Talk
> Subject: Isdefined Issue
>
> HI all
>  
> Can't figue out why I am getting this error:
>  
> Parameter 1 of function IsDefined which is now
> "QGetProjects.PROJ_NAME[2]"
> must be a syntactically valid variable name
>  
> It is used in this if statement:
>  
> <CFSET R = Records +1>
> <CFIF isdefined("QGetProjects.PROJ_NAME[#R#]") and
> (QGetProjects.PROJ_NAME[Records] EQ
> QGetProjects.PROJ_NAME[Records+1])>
>  
> If I take out the isdefined all works until I hit a record that is not
> defined.
>  
> QGetProjects is a query.
>  
> I can:
>  
> <CFOUTPUT>
>     #QGetProjects.Proj_Name[2]#
>  </CFOUTPUT>
>  
> So the variable is valid.
>  
>  
> I am using CF 5
>  
> Anyone know this issue??
>  
> Thanks for any help
> Rodney
>
>
>
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to