14.03.2014, 16:53
You should use weak enum tags (weak tags start with lower case letter, strong with upper case)
Weak tags don't case warnings if the tag wasn't defined in the function
Also the sort function doesn't seem correct
Weak tags don't case warnings if the tag wasn't defined in the function
Also the sort function doesn't seem correct
pawn Код:
enum eListInfo
{
l_int,
l_str[10],
Float:l_float
}
new List[][eListInfo] = {
{2,"Test2",2.2},
{1,"Test1",1.1},
{4,"Test4",4.4},
{3,"Test3",3.3},
{5,"Test5",5.5}
};
BubbleSort(array[][], idx = 0, start = 0, len = sizeof(array)) { // code from wikipedia
new
i,
l
;
len--;
do {
for(l = 0, i = start; i < len; ++i) {
if(array[i + 1][idx] < array[i][idx]) {
ExchangeArraySlots(array, i + 1, (l = i)); // taken from md-sort by Slice
// https://sampforum.blast.hk/showthread.php?tid=343172
}
}
} while((len = l));
}