[WebDNA] is this expected behavior for [arrayget]?
This WebDNA talk-list message is from 2009
It keeps the original formatting.
numero = 103224
interpreted = N
texte = Is anyone out there using [arrayset] or [arrayget] ??I am starting to, but finding some un-desired behavior.There are certainly other ways of accomplishing what I am doing.. but I thought it would be fun to learn webdna's array syntax.I would love to rely on this and learn it well while developing, but I am under enough time pressure to want to avoid being the lone scout in this territory. Thus my question.. Has anyone spent much time with webdna arrays? What did you find.. Work as expected? Or what are the issues?Here is an example of one issues I am finding. (I hope it is just due to my own misunderstanding, and not webdna source-code bugs/ features! ;-)this code:----------------------------------------------------------------------------------------------------[arrayset name=ReqdFormVars&dim=12] (1 )= UserID &(2 )= EnterPassword &(3)=ReEnterPassword&(4)=FirstName&(5)=LastName&(6)=Address[!] [/!]&(7 )= City &(8 )= State &(9)=PostalCodeZip&(10)=Country&(11)=PhoneNumber&(12)=EMailAddress[/ arrayset][ArrayGet name=ReqdFormVars][loop start=1&end=[DimSize_1]&advance=1][index]-([index])=([index]),[interpret][([index])][/interpret].[!][/!][text show=F]testvar[index]=([index])[/text][!][/!][/loop][/ArrayGet]testvar1=[testvar1]testvar1=[interpret][[testvar1]][/interpret]testvar12=[testvar12]testvar12=[interpret][[testvar12]][/interpret]UserID=[UserID]EMailAddress=[EMailAddress]----------------------------------------------------------------------------------------------------returns:=========================================================1-UserID=UserID,[UserID].2-EnterPassword=EnterPassword,[EnterPassword].3-ReEnterPassword=ReEnterPassword,[ReEnterPassword].4-FirstName=FirstName,[FirstName].5-LastName=LastName,[LastName].6-Address=Address,[Address].7-City=City,[City].8-State=State,[State].9-PostalCodeZip=PostalCodeZip,[PostalCodeZip].10-Country=Country,[Country].11-PhoneNumber=PhoneNumber,[PhoneNumber].12-EMailAddress=EMailAddress,[EMailAddress].testvar1=(1)testvar1=[(1)]testvar12=(12)testvar12=[(12)]UserID=thisIsATestUserEMailAddress=thisIsATestEmail=========================================================Why does (1) not evaluate to "UserID" when *inside* the [text] context which is inside the [arrayget], like it does when *outside* the [text]?Why does [interpret] not work inside the [arrayget]?(Note, in case it affect the source code debugging (if we call this a bug), then note that all this code is inside a square-bracket include which I call with
(from an XML syntax page.)Those last 2 incoming formvars ([UserID] and [EMailAddress]) are evaluating correctly. but I want their values *inside the [arrayget]*, so I can validate the user input, etc.I know I can validate user input so many other ways.. but that is not the point. I wanted to get another webdna context up to speed in my arsenal.What is the use of arrays if we can't do stuff inside them?! Not to sound complainey; ..just making sure I know what I am working with. Anyone have any experience with webdna arrays worth mentioning? ...and/or can you see something I am not thinking right?------------John Butler (Govinda)govinda.webdnatalk@gmail.com
Associated Messages, from the most recent to the oldest:
Is anyone out there using [arrayset] or [arrayget] ??I am starting to, but finding some un-desired behavior.There are certainly other ways of accomplishing what I am doing.. but I thought it would be fun to learn webdna's array syntax.I would love to rely on this and learn it well while developing, but I am under enough time pressure to want to avoid being the lone scout in this territory. Thus my question.. Has anyone spent much time with webdna arrays? What did you find.. Work as expected? Or what are the issues?Here is an example of one issues I am finding. (I hope it is just due to my own misunderstanding, and not webdna source-code bugs/ features! ;-)this code:----------------------------------------------------------------------------------------------------[arrayset name=ReqdFormVars&dim=12] (1 )= UserID &(2 )= EnterPassword &(3)=ReEnterPassword&(4)=FirstName&(5)=LastName&(6)=Address[!] [/!]&(7 )= City &(8 )= State &(9)=PostalCodeZip&(10)=Country&(11)=PhoneNumber&(12)=EMailAddress[/ arrayset][ArrayGet name=ReqdFormVars][loop start=1&end=[DimSize_1]&advance=1][index]-([index])=([index]),[interpret][([index])][/interpret].[!][/!][text show=F]testvar[index]=([index])[/text][!][/!][/loop][/ArrayGet]testvar1=[testvar1]testvar1=[interpret][[testvar1]][/interpret]testvar12=[testvar12]testvar12=[interpret][[testvar12]][/interpret]UserID=[UserID]EMailAddress=[EMailAddress]----------------------------------------------------------------------------------------------------returns:=========================================================1-UserID=UserID,[UserID].2-EnterPassword=EnterPassword,[EnterPassword].3-ReEnterPassword=ReEnterPassword,[ReEnterPassword].4-FirstName=FirstName,[FirstName].5-LastName=LastName,[LastName].6-Address=Address,[Address].7-City=City,[City].8-State=State,[State].9-PostalCodeZip=PostalCodeZip,[PostalCodeZip].10-Country=Country,[Country].11-PhoneNumber=PhoneNumber,[PhoneNumber].12-EMailAddress=EMailAddress,[EMailAddress].testvar1=(1)testvar1=[(1)]testvar12=(12)testvar12=[(12)]UserID=thisIsATestUserEMailAddress=thisIsATestEmail=========================================================Why does (1) not evaluate to "UserID" when *inside* the [text] context which is inside the [arrayget], like it does when *outside* the [text]?Why does [interpret] not work inside the [arrayget]?(Note, in case it affect the source code debugging (if we call this a bug), then note that all this code is inside a square-bracket include which I call with (from an XML syntax page.)Those last 2 incoming formvars ([UserID] and [EMailAddress]) are evaluating correctly. but I want their values *inside the [arrayget]*, so I can validate the user input, etc.I know I can validate user input so many other ways.. but that is not the point. I wanted to get another webdna context up to speed in my arsenal.What is the use of arrays if we can't do stuff inside them?! Not to sound complainey; ..just making sure I know what I am working with. Anyone have any experience with webdna arrays worth mentioning? ...and/or can you see something I am not thinking right?------------John Butler (Govinda)govinda.webdnatalk@gmail.com
John Butler
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
BIG PROBLEMS with Checkboxes!!! (1998)
Weird problems with [SHOWIF]s (1997)
searching by date (1998)
Wanted: More Math Functions (or, Can You Solve This?) (1997)
Re:What file? (1997)
Request Time Out (1997)
emailer (1997)
WebCatalog Technical Reference (1997)
Trouble Searching (1999)
[WebDNA] preventing hackers from posting their own (altered) version of my form? (2009)
shownext not showing next...still r2 (1997)
PCS Frames (1997)
ANother SHOWIF problem (1997)
WebCat2 Append problem (B14Macacgi) (1997)
LinkExchange (1997)
FileMaker and WebCat (1999)
Weird problems with [SHOWIF]s (1997)
Security for malls with different webmasters (1998)
Help with dates (2001)
WebCat2b12 CGI Mac - [shownext] problem (1997)