Quotes Required Around Keys in 2 Dimensional Arrays?
Sivakatirswami
katir at hindu.org
Sun Apr 14 20:11:01 EDT 2002
I use arrays mostly in CGI's and have found that quotes are required around
the key to pass its value... but this does not appear to be documented..
in the following example, if I don't quote the key "email" inside the
brackets, nothing is returned. But there is no mention of this in the
documentation... is there something I am missing?
## this is the beginning of a script.cgi that processes
## data submitted by an HTML form by POST:
on startUp
read from stdin until empty
put urlDecode (it) into tDataIn
split tDataIn by "&" and "="
put isWellFormedMailtoScheme (tDataIn ["email"]) into emailCheck
switch emailCheck
case "False"
put badEmail(fixYourEmail) into tResponse
break
case "True"
etc.
#######
Now in the above example, using (tDataIn[email]) will not work...it passes
empty to the email checker which then breaks.
This is not a big deal (putting quotes around the keys) but it was an
unexpected requirement... other posts I have on the MC list and here don't
use quotes... so, am I doing something wrong?
Hinduism Today
Sivakatirswami
Editor's Assistant/Production Manager
katir at hindu.org
www.HinduismToday.com, www.HimalayanAcademy.com,
www.Gurudeva.org, www.hindu.org
Read The Master Course Lesson of the Day at
http://www.gurudeva.org/lesson.shtml
More information about the use-livecode
mailing list