combine behavior

Harvey Toyama harvey.toyama at qlogic.com
Mon Nov 21 17:04:36 EST 2005


Hi Jan,
Thanks. Your solutions work. I wish a numeric sort were a switch enabled
behavior for "combine", though.

-- Harvey
-- 
 

-----Original Message-----
From: use-revolution-bounces at lists.runrev.com
[mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of Jan
Schenkel
Sent: Monday, November 21, 2005 11:07 AM
To: How to use Revolution
Subject: Re: combine behavior

--- Harvey Toyama <harvey.toyama at qlogic.com> wrote:
> Hi,
> 
> I'm using the split and combine to manipulate
> database records. I notice
> that the documentation says that the order of the
> elements is based on
> an internal order. I require a known order for the
> INSERT and UPDATE
> commands to line up correctly. How can I know the
> order in which my
> elements will recombine from an array? It would seem
> ideal if I could
> set the index to be numeric and to use a binary
> sort.
> 
> Any suggestions?
> 
> -- Harvey
> 

Hi Harvey,

You are correct: combine will place them in an
internal order (which happens to be the hash-value of
the keys of the array).

There are two options: either you roll your own
combine command, or you use the sort command after
combining the array, to get it in the order you want.

Option 1:
--
put the keys of tDataArray into tKeys
sort tKeys numeric             ## or some other sort
repeat for each line tKey in tKeys
  put tkey & return after tSortedData
end repeat
delete char -1 of tSortedData  ## remove trailing
return
--

Option 2:
--
combine tDataArray using return and tab
sort tDaatArray numeric by item 1 of each
--

Of course, you'll have to adapt the above a bit to
suit the structure of the data in your array.

Hope this helped,

Jan Schenkel.


Quartam - Tools for Revolution
<http://www.quartam.com>

=====
"As we grow older, we grow both wiser and more foolish at the same
time."  (La Rochefoucauld)


		
__________________________________ 
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com
_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list