(Meanwhile I also posted a link to this thread in the 'General' subforum:
http://forum.lazarus.freepascal.org/index.php/topic,35734.0.html.)
Greetings again after a while.
I tried to use the unit URadixSort and the function RadixSort defined there to create a dll. Since I failed in a strange way I made a simple test with a console program on Win 10. Follow the code and the result:
program TradixsortTerminal;
uses
Crt, Sysutils, Classes, URadixSort;
var arr: array[0..7] of Integer; j: Integer;
begin
arr[0]:=999; arr[1]:=111; arr[6]:=666; arr[7]:=777;
arr[2]:=4; arr[3]:=2; arr[4]:=5; arr[5]:=3;
RadixSort(arr);
ClrScr;
for j := 0 to 7 Do
WriteLn(arr[j]);
Repeat until ReadKey = #27;
end.
{
The output to the console was :
2
3
4
5
666
777
777
777
}
The first and the second element (indices 0, 1) were lost. The highest number was repeated on the unused high places twice. A translation of indices to [2..7] with the respective assignments and the loop adapted produced exactly the same result.
In a different case not using radixsort passing dynamic arrays to procedures/functions worked as expected.
What did I wrong? Or is there a bug?
(Lazarus 1.6.2 with FPC 3.0.0 on Win 10)