It is unsupported and not recommended. This means that using that function has not been tested thoroughly, and if your application fails because of some strange output, much like John’s initial post, you’ll have to build a workaround or use a different method. If I choose to implement this feature in the future, there is no guarantee that my solution won’t break your code as I am not held to being backwards compatible with an existing function.
I believe that the primary reason for this function never making into the docs is because if you want to associate an integer, like a Primary Key, the reference becomes ambiguous. There may be a second issue revolving around the detection of a name (string reference) vs a row/col number (integer reference). That said, I agree that this concept is the best way to go about setting associations to Witango arrays and is a powerful tool. Updating array handling is high on my list and may make it into version 6.1 even. Of course, I want to add a lot more than just column zero support. Robert From: Robert Garcia [mailto:[email protected]] Sent: Wednesday, December 08, 2010 5:18 PM To: [email protected] Subject: Re: Witango-Talk: Array value Understand, but you said "unsupported" and "not recommended" which makes it sound like it is something that shouldn't be done, and could be deprecated or removed, which would break code if that is being used by others. I can tell you that I/we have used that technique many times. It also seems to me like a very VALID technique, a way of making an ASSOCIATIVE array, within witango. -- Robert Garcia President - BigHead Technology VP Application Development - eventpix.com 15520 Coutelenc Rd Magalia, Ca 95954 ph: 530.645.4040 x222 fax: 530.645.4040 [email protected] - [email protected] http://bighead.net/ - http://eventpix.com/ On Dec 8, 2010, at 9:23 AM, Robert Shubert wrote: As I said, it’s not documented, and therefore not an “official” function of the server. Robert From: Robert Garcia [mailto:[email protected]] Sent: Wednesday, December 08, 2010 11:08 AM To: [email protected] Subject: Re: Witango-Talk: Array value Unsupported? That is a technique I think many of us have used for many moons. Why would it not be supported? -- Robert Garcia President - BigHead Technology VP Application Development - eventpix.com 15520 Coutelenc Rd Magalia, Ca 95954 ph: 530.645.4040 x222 fax: 530.645.4040 [email protected] - [email protected] http://bighead.net/ - http://eventpix.com/ On Dec 7, 2010, at 6:17 PM, Robert Shubert wrote: John, What you are attempting to do here, assigning a key value into column zero, is undocumented and unsupported. In fact, while it does seem to work, it is not recommended for use. Currently only assignment into row zero (column naming) is supported. Until I have an opportunity to look into column zero in a future version, I would recommend that you use the @FILTER tag to identify a particular row. As such: <@ASSIGN myFocusRow <@FILTER array=request$myArray expr=”#1 = ‘Key1’>> <@IF @@myFocusRow> <@! We found a row with Key1> <@VAR myFocusRow[1,2]> = Value 1 <@ELSE> <@! No row found> </@IF> All that said, what is happening is that an unknown key value is interpreted as a zero. Therefore, when you do <@VAR request$myArray[boguskey,2]> what you get back is the same as <@VAR request$myArray[0,2]>. Knowing that may help you build a test for a bad key, by matching the returned value to the row zero value. I hope that helps for now, and I will look into column zero and other issues regarding arrays in 2011 to hopefully make them much more useful. Robert PS. Checking to see if an array column contains a value can be done with <@IF expr=”<@VAR myArray[*,1]> contains ‘keyValue’”><@! It does></@IF> From: John Hotaling [mailto:[email protected]] Sent: Tuesday, December 07, 2010 10:20 AM To: [email protected] Subject: Witango-Talk: Array value Hello: We're "reading in" a simple key/value list from a table via a stored procedure and assigning to an array in Witango. We then assigned the "0" column to the key name in column 1 for easy value lookup - something like <@FOR START="1" STOP="<@NUMROWS ARRAY='request$MyArray'>" STEP="1"> <@ASSIGN "request$MyArray[<@CURROW>,0]" <@VAR "request$MyArray[<@CURROW>,1]">> </@FOR> So, <@var request$MyArray[Key1,2]> = Value1 <@var request$MyArray[Key2,2]> = Value2 etc However, if a particular key does NOT exist (which happens in our scenario) in the db (say Key3) then <@var request$MyArray[Key3,2]> is returning "value" instead of an empty value (as does <@var request$MyArray[somebogusname,2]>). I was expecting an empty value here. It's been awhile, but maybe this method is not optimal for checking the existence of a particular key/value pair in addition to accessing the values of various keys. Thanks in advance for any insight or recommendations. John Robert, best of luck with the recent acquisition. As so many have already commented, we also appreciate your diligence and responsiveness on the talk list and look forward to seeing where you take the product. I can't believe we started using the product back in 1996 - what a journey. -- John Hotaling [email protected] www.AuctionAnything.com 800-866-8009 _____ To unsubscribe from this list, please send an email to [email protected] with "unsubscribe witango-talk" in the body. _____ To unsubscribe from this list, please send an email to [email protected] with "unsubscribe witango-talk" in the body. _____ To unsubscribe from this list, please send an email to [email protected] with "unsubscribe witango-talk" in the body. _____ To unsubscribe from this list, please send an email to [email protected] with "unsubscribe witango-talk" in the body. _____ To unsubscribe from this list, please send an email to [email protected] with "unsubscribe witango-talk" in the body. ---------------------------------------- To unsubscribe from this list, please send an email to [email protected] with "unsubscribe witango-talk" in the body.
