You should either do

 

A) (in pseudocode)

 

<@FOR array=checkedboxarray>

<@ADDROWS myfinalarray <@FILTER my30colarray expr=”#1 = <@COL 1>”>>

</@FOR>

 

Or B)

 

Hit the DB again with an “where … is in” clause

 

The larger the dataset, the more likely the SQL hit will be faster.

 

Robert

 


From: Ted Wolfley [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 04, 2005 4:13 PM
To: [email protected]
Subject: RE: Witango-Talk: filtering arrays

 

What I am doing is bring back information from a 30 column table and putting it into an array.  The array is used to create a selection form using the unique id for the checkbox value.  After the submit, I use the <@POSTARG NAME='a_userid' TYPE=ARRAY> to create an one column array of the checked selections. 

 

What I am trying to do is to use the selected values to bring back data from the orignial array to create a confirmation page before I preform the next action.  Since I already have the data in an array I thought I could use it.  The <@union> tag won't work because it combines. The <@intersect> tag requires that the two arrays have the same number of columns.  May be I should just use an another Direct DBMS action instead.

 

Ted

 


From: Robert Garcia [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 04, 2005 3:14 PM
To: [email protected]
Subject: Re: Witango-Talk: filtering arrays

Looping through rows should be avoided in witango whenever another solution is possible. Row looping is an expensive task.

 

Try something like this, since it is a comma delimited list, you can turn into an array and filter. You can turn into array with the <@array> tag, or:

 

<@assign request$temp <@transpose <@tokenizer "<@var request$vdeletelist>" chars=",">>

<@! now you have a 1 column array with you items >

 

Then you can use <@union> to see where the arrays intersect.

 

-- 

 

Robert Garcia

President - BigHead Technology

VP Application Development - eventpix.com

13653 West Park Dr

Magalia, Ca 95954

ph: 530.645.4040 x222 fax: 530.645.4040

 

On May 4, 2005, at 12:01 PM, Ted Wolfley wrote:



I couldn't get this to work, I think it is because of a comma delimited list of values and contains uses only one value.   I went with using a row loop inside another row loop.

 

ted

 


From: Ben Johansen [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 04, 2005 2:48 PM
To: [email protected]
Subject: RE: Witango-Talk: filtering arrays

Try this

<@ASSIGN NAME="vconfirmlist" VALUE="<@FILTER ARRAY='varrayout' EXPR=”@@request$vdeletelist’ contains #usrid>" SCOPE="request">

Might work, I did this once but cant find code


 

Ben Johansen - http://www.pcforge.com
Authorized Witango & MDaemon Reseller
Available for Web App. Developement


From: Ted Wolfley [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 04, 2005 6:22 AM
To: [email protected]
Subject: Witango-Talk: filtering arrays


 

Hi,


 

I am trying to <@filter> an array by using values already selected from the array.  The sql equivalent is "select * from array where userid in (selected list)".

Can a list of values be used in the filter action?


 

<@ASSIGN NAME="vconfirmlist" VALUE="<@FILTER ARRAY='varrayout' EXPR='#usrid in (@@request$vdeletelist)'>" SCOPE="request">

@@request$vdeletelist has numeric values that are separated by commas and #usrid  is a numeric column.


 

Thanks.

Ted Wolfley
Database/Internet Programmer
The Ogden Group of Rochester
phone: (585) 321 1060 x23
fax: (585) 321 0043
[EMAIL PROTECTED]

www.ogdengroup.com


 

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf



 

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Reply via email to