10-29-2014, 08:45 PM
Try this for string arrays:
Macro Align String Arrays
Macro Align String Arrays
str a2=
;AA
;BB
;FF
;GG
;HH
str a1=
;CC
;DD
;EE
;FF
;GG
ARRAY(str) a b
a=a1; b=a2
ARRAY(str) c.create(a.len*4)
ARRAY(str) d.create(b.len*4)
int i j k; int base=65
for i 0 a.len
,j=a[i][0]-base
,c[j]=a[i]
for i 0 b.len
,k=b[i][0]-base
,d[k]=b[i]
if(j>k) c.redim(j+1); d.redim(j+1)
else c.redim(k+1); d.redim(k+1)
a=c; b=d;
c.redim; d.redim
out
for i 0 a.len
,out "a[%i]= %s" i a[i]
out ""
for i 0 b.len
,out "b[%i]= %s" i b[i]