Hi,
A4D doesn't support DISTINCT VALUES. What are the common replacements?
I tried this code, it is very slow but inside a 4D database it flies!
4D 2003.3, MacOSX 10.2.8
<%
all records([Stock])
array text($aMake;0)
selection to array([Stock]Make;$aMake)
DistinctValues($aMake)
%>
In a lib:
method "DistinctValues" (&$inArray)
c_longint($k;$NextValue)
SORT ARRAY($inArray;>)
$NextValue:=1
For ($k;2;Size of array($inArray))
If ($inArray{$k-1}#$inArray{$k})
$inArray{$NextValue}:=$inArray{$k-1}
$NextValue:=$NextValue+1
End if
End for
If ($NextValue<Size of array($inArray))
$inArray{$NextValue}:=$inArray{$k-1}
DELETE ELEMENT($inArray;$NextValue+1;Size of array($inArray))
End if
end method
--
Greetings,
[4D-Consulting.com]eK, Wiesbaden
Peter Schumacher
--------------------------------------------------------
Web: http://www.4D-Consulting.com/
AIM/iChat: PeterInWiesbaden
0800-4D-Infos / 0800-43.46.367 - Fax: 0800-43.46.637
Intl +49-611-9406.850 - Intl: +49-611-9406.744
_______________________________________________
Active4D-dev mailing list
[EMAIL PROTECTED]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/