Ok, this won't work.It looks to me that you are trying to make a two dimensional array, or add to arrays together.
The statement:
$array4=$array2,$array3
does not work. You cannot return all the elements of $array2 byt just putting $array2 in the statement. If you want to simulate
$array4=$array2,$array3
or in pseudo code,
$array4=contents of $array2 and contents of $array3 (alright, so it's not real pseudocode)
try this:
code:
break on cls
$array2=1,2,3,4
"$$array2: "
for each $thing in $array2
$thing ; ", " ; this is replaced by the if...
if $thing<>$array2[ubound($array2)] ", " endif ; stops comma on the end
next
? ?
$array3=5,6,7,8
"$$array3: "
for each $thing in $array3
$thing
if $thing<>$array3[ubound($array3)] ", " endif
next
? ?
$=execute('$$array4='+join($array2, ",")+','+join($array3, ","))
"$$array4: "
for each $thing in $array4
$thing
if $thing<>$array4[ubound($array4)] ", " endif
next
? ?
function join($array, $separator)
; crude implementation of VBJoin, I'll make a better one later.
; p.s. Ruud, can you put a function like this in Beta 3 
; but make it the same as the VBS one...
$join="" ; reset output
for each $thing in $array
$join=$join+$thing+$separator ; add items together
next
$join=substr($join, 1, len($join)-1) ; strip last comma
endfunction
cj
p.s. You can't use
if $thing<>$array2[ubound($array2)] ", " endif
if there is more than one occurance of the last element of the array. eg:
if array='1,2,3,4,1,2,3,4" you will get 1, 2, 3, 41, 2, 3, 4 because the ", " is not printed for the 4 because the last element is a 4.
In this case, just use the Join function.
[This message has been edited by cj (edited 03 May 2001).]