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> registrant["emergencyPhone"]["Phone"]["countryCode"] = 1;
JJ> Is this new in CFMX? I used to name variables with dots in them to
JJ> sort of give pseudo-scopes to groups of variable. Maybe it's always
JJ> behaved this way, but I never had occasion to dump one?
JJ> This has very strange consequences when doing something like this
JJ> (please try running this form yourself):
JJ> <form action="" method="post">
JJ> <input type="hidden" value="123" name="blah.blee.bloo">
JJ> <input type="submit" name="submit" value="submit">
JJ> </form>
JJ> <cfscript>
JJ> form.blah.blee.bloo = 234234;
JJ> </cfscript>
JJ> <cfdump var=#form#>
JJ> The dump shows both variables in the form scope, but shows the "true,"
JJ> posted form variable as a simple variable (blah.blee.bloo), but the
JJ> locally set form variable is a structure of structures.
JJ> I guess the lesson is not to have dots as delimiters in form vars
JJ> anymore, but can someone explain what's at work here? Also, can I (and
JJ> should I) always expect that this dot notation for structures will
JJ> work, and can I start using (and relying on) that notation?
JJ> Thanks,
JJ> Jamie
JJ>
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
- Dots in variable names behaving unexpectedly Jamie Jackson
- RE: Dots in variable names behaving unexpectedly Raymond Camden
- Re: Dots in variable names behaving unexpectedly Jim McAtee
- RE: Dots in variable names behaving unexpecte... Raymond Camden
- RE: Dots in variable names behaving unexpectedly Barney Boisvert
- RE: Dots in variable names behaving unexpecte... Raymond Camden
- Re: Dots in variable names behaving unexpectedly Matt Liotta
- RE: Dots in variable names behaving unexpectedly Critter
- RE: Dots in variable names behaving unexpectedly Douglas.Knudsen