Alex Tweedly wrote:
At 20:25 30/09/2004 -0700, Mark Brownell wrote:
What do you get for this? I'm not sure I did this right. [untested]
repeat for each element i in x
put i return after tResults
end repeat
put tResults into field 2
I don't see anything in the documentation of
On Friday, October 1, 2004, at 02:48 AM, Alex Tweedly wrote:
[...]
Of course, if the problem initially posed had been slightly different,
then these methods might have been required. And similarly, the
scripts from both Mark and me used cr rather than the
lineDelimiter; an assumption NOT
On Friday, October 1, 2004, at 03:41 AM, Martin Baxter wrote:
But as soon as you do:
put j into tvar[10]
The element order would then be:
[1]a
[10]j
[2]b
[3]c
[4]d
[5]e
[6]f
[7]g
[8]h
[9]i
HTH
Martin Baxter
Thanks for the heads up on this.
I've never tried using the for each element x except
Thanks to all who replied.
And specifically to Alex Tweedly. In the past, I've always used this
form. Don't know why I didn't on this occasion.
Moving on gently into dementia.
Jim
___
use-revolution mailing list
[EMAIL PROTECTED]
I have an array
x[1]
x[2]
x[3]
...
etc.
I combine x by return and put into a field. But the elements of the
array are not ordered 1, 2,3 etc.
I don't want to sort the list in the field by the values but by the
numerical order of the keys.
I do that now by brute force:
repeat with i = 1 to m
On Thursday, September 30, 2004, at 02:48 PM, Jim Hurley wrote:
repeat with i = 1 to m
put x[i] into line i of tResults
end repeat
put tResults into field 2
But is there any quick way to get the list sorted by the keys? I have
11,000 elements in the array.
Jim
Maybe by using a faster
Untested, but this might work:
put the keys of x into y
sort lines of y
put empty into z
repeat with i = 1 to the number of lines in y
put x[i] the lineDelimiter after z
end repeat
delete the last char of z
put z into field 2
On Sep 30, 2004, at 6:50 PM, Mark Brownell wrote:
On Thursday,
At 15:50 30/09/2004 -0700, Mark Brownell wrote:
On Thursday, September 30, 2004, at 02:48 PM, Jim Hurley wrote:
repeat with i = 1 to m
put x[i] into line i of tResults
end repeat
put tResults into field 2
takes 170 ticks for 11,000 elements on my slow machine
But is there any quick way to
Untested, but this might work:
put the keys of x into y
sort lines of y
-- sort lines of y numeric
put empty into z
repeat with i = 1 to the number of lines in y
-- repeat for each line i in y
put x[i] the lineDelimiter after z
end repeat
delete the last char of z
put z into field 2
Robert
On Thursday, September 30, 2004, at 05:48 PM, Alex Tweedly wrote:
At 15:50 30/09/2004 -0700, Mark Brownell wrote:
Maybe by using a faster repeat loop and a simpler append technique.
put into tResults
put 1 into i
repeat
put x[i] return after tResults
if x[i] = empty then exit repeat
10 matches
Mail list logo