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 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 always behaved this way, but I never had occasion
> > to dump one?
>
> Yes, it is new to CFMX. However, it has _always_ been bad
> practice (imho) to
> create variables like this. I always suggest folks go through
> the trouble
> of:
>
> <cfset registrant = structNew()>
> <cfset registrant.emergencyPhone = structNew()>
> etc
>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to