>******************************************************************** >* Description.......: BTCC_MultiList.BTC_ItemList: method to return a comma-delimited list of the selected items >* Calling Samples...: >* Parameter List....: >* Created by........: MDA >* Modified by.......: Nadya Nosonovsky 12/29/1999 04:20:21 PM >******************************************************************** >* 11/26/99 NN added into this method an ability to populate btcselarray >* 12/14/99 NN added AllSelected property > >* Returns a comma-delimited list of quoted codes corresponding to those selected. >* If none, returns the empty string. >local result, n, k, lnSel, lnLen > >* check for empty array special case >if alen(this.btcvalarray) && array is empty > return '' && null list result >endif > >result = '' && start with nothing >k=0 >lnSel=0 > >with this > > lnLen=alen(.btcvalarray, 1) >* loop over the array, building list of selected codes > for n = 1 to lnLen && cycle over rows > if .Container1.List1.selected(m.n) && this item is selected > lnSel=lnSel+1 && increment count of selected items > if k>=1 and ascan(.btcselarray, .btcvalarray[m.n, 2])>0 && This code already exists >* Do nothing > else > result = m.result + iif(empty(m.result), '', ',') ; > + '"' + .btcvalarray[m.n, 2] + '"' && tack on another code > k=k+1 > dimension .btcselarray[k] && redim array > .btcselarray[m.k]= .btcvalarray[m.n,2] > endif > endif > endfor > > .btccrit=m.result && store in a property > > if lnSel=lnLen and not .ExcludeFlag && All selected and don't need to be excluded > .AllSelected=.t. > m.result='' && empty criterion > else > .AllSelected=.f. > endif >endwith >return m.result && done - return list of selected codes>