Can someone give me the lowdown on why...
registrant.emergencyPhone.Phone.countryCode = 1;
...is equivalent to...
registrant[emergencyPhone][Phone][countryCode] = 1;
Is this new in CFMX? I used to name variables with dots in them to
sort of give pseudo-scopes to groups of variable. Maybe it's
Can someone give me the lowdown on why...
registrant.emergencyPhone.Phone.countryCode = 1; ...is
equivalent to...
registrant[emergencyPhone][Phone][countryCode] = 1;
Is this new in CFMX? I used to name variables with dots in
them to sort of give pseudo-scopes to groups of variable.
That changed in MX. Variables cannot have dots in their names. If they
do, CFMX automatically creates nested structs. See the documentation
for more information on what changed.
-Matt
On Mar 23, 2004, at 1:11 PM, Jamie Jackson wrote:
Can someone give me the lowdown on why...
To: CF-Talk
Subject: Dots in variable names behaving unexpectedly
Can someone give me the lowdown on why...
registrant.emergencyPhone.Phone.countryCode = 1;
...is equivalent to...
registrant[emergencyPhone][Phone][countryCode] = 1;
Is this new in CFMX? I used to name variables with dots in them
- Original Message -
From: Raymond Camden [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Tuesday, March 23, 2004 11:19 AM
Subject: RE: Dots in variable names behaving unexpectedly
Can someone give me the lowdown on why...
registrant.emergencyPhone.Phone.countryCode = 1
Why do you suggest folks go through the extra steps?Just curious.
Cheers,
barneyb
-Original Message-
From: Raymond Camden [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 23, 2004 10:19 AM
To: CF-Talk
Subject: RE: Dots in variable names behaving unexpectedly
Can someone give me
Hello Jamie,
i believe that adding dot notation to a variable automatically creates
a structure in MX
/crit
Tuesday, March 23, 2004, 1:11:45 PM, you wrote:
JJ Can someone give me the lowdown on why...
JJ registrant.emergencyPhone.Phone.countryCode = 1;
JJ ...is equivalent to...
JJ
cfset registrant = structNew()
cfset registrant.emergencyPhone = structNew()
etc
In CF5, if not setting (sub)structs like this, i.e.
cfset registrant = structNew()
cfset registrant.emergencyPhone.countrycode = 1
What kind of variable is emergencyPhone.contrycode?Has CF
created
Why do you suggest folks go through the extra steps?Just curious.
No real reason except that I don't like it when the language does something
for me - I'd rather know exactly what is going on and have it be clear in
the code. I don't believe it is any kind of performance issue though.
Also,
9 matches
Mail list logo