Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
Flashm@n #1
Is Defined and Dynamic Application Variables
Hi I'm trying to create dynamic variables in the application scope and then
check for variables existance using the Is Defined function. Basically I check
to see if a application variable is defined if it is then I add a value to the
existing value (creating a comma seprated list in the application scope).
However if the variable does not yet exist I want to create it and add a value
to it. The code I have been using is: <CFARGUMENT NAME='varA'
REQUIRED='Yes'> <CFARGUMENT NAME='varB' REQUIRED='Yes'> <cfif Not
IsDefined('application.grproom.room#varB#')> <cfset
application['grp.grp#varB#'] = #varA#> <cfset message = 'Is not defined'>
<cfelse> <cfset application['grp.grp#varB#'] =
ListAppend(application['grp.grp#varB#'], #varA#)> <cfset message = 'Is
Defined, new element added'> </cfif> I've tried defining and checking the
variables in a number of methods and I know I'm not too far off getting it
nailed, but I've hit a brickwall. Can anyone help? Thanks Matt
Flashm@n Guest
-
Application (doc_connect/room_01) is not defined.
Hi im trying to get the sample file doc_connect to show but i keep getting this error. Anyone know why and how i cna get around it? Here is the... -
Scope of variables defined in text objects
What's the scope of a variable assigned to a text object? Its own timeline, _root, or what? -
Perl defined variables
Hi, could anybody please illustrate with an example the use of the following variables : $/ $* or more specifically here is the code i have.... -
undefined reference ... expected to be defined in a dynamic image
I'm running a Mac: 10.3 with perl 5.8.1. I can't seem to get HTML::parser-3.35 working. Running make seems to be OK--no errors (see below). ... -
Global variables - application variables vs include file
What are the best methods for using global constants and variables? I've noticed that many people put all global constants in a file and include... -
TA-Selene #2
Re: Is Defined and Dynamic Application Variables
You are not working with plain Application variables, rather elements of a
structure stored in Application scope. Try something like this: <cfif Not
StructKeyExists(Application.prgroom, '#varB#')> <cfset
application.grp['grp#varB#'] = varA> <cfset message = 'Is not defined'>
<cfelse> <cfset application.grp['grp#varB#'] =
ListAppend(applicationgrp['grp#varB#'], varA)> <cfset message = 'Is Defined,
new element added'> </cfif>
TA-Selene Guest



Reply With Quote

