Re: Sort multi-dimensional arrays (enums supported) -
Slice - 31.01.2013
May I see the code that does the sorting, and related enum declarations?
Re: Sort multi-dimensional arrays (enums supported) -
zopert - 31.01.2013
Thank you, Slice! When I saw this topic, born many ideas. ^^
Re: Sort multi-dimensional arrays (enums supported) -
habl - 31.01.2013
Quote:
Originally Posted by Slice
May I see the code that does the sorting, and related enum declarations?
|
I didn't even add it yet, I only added the include. Just as soon as I add it to the gamemode it can't compile:
Re: Sort multi-dimensional arrays (enums supported) -
Slice - 01.02.2013
Err... you probably messed up the newlines somehow - try just copying the contents
here then pasting it into md-sort.inc.
Re: Sort multi-dimensional arrays (enums supported) -
habl - 02.02.2013
Ok, kinda stupid but seems it was a download issue indeed. Retried it in a differnet browser and now it works. How stupid is that :P
Thanks for your help!
Re: Sort multi-dimensional arrays (enums supported) -
Slice - 02.02.2013
Let me guess, you used Internet Explorer?
Re: Sort multi-dimensional arrays (enums supported) -
habl - 03.02.2013
No, Firefox was the failing browser. In Chrome it worked fine.
Re: Sort multi-dimensional arrays (enums supported) -
fordawinzz - 03.02.2013
I want to sort a single dimensional array which contains player kills, should I use the custom comparator ?
Re: Sort multi-dimensional arrays (enums supported) -
Slice - 03.02.2013
Use this:
http://forum.sa-mp.com/showpost.php?...postcount=3437
AW: Sort multi-dimensional arrays (enums supported) -
Mellnik - 01.03.2013
Slice, i found a problem in your include.
I've looked in the script report (generated with -r)
Код:
<member name="M:SortArrayUsingComparator_QS" syntax="SortArrayUsingComparator_QS(array, func, left, right)">
<stacksize value="10"/>
<referrer name="SortArrayUsingComparator_Entry"/>
<referrer name="SortArrayUsingComparator_QS"/>
<dependency name="ExchangeArraySlots"/>
<param name="array">
</param>
<param name="func">
</param>
<param name="left">
</param>
<param name="right">
</param>
</member>
Код:
<member name="M:SortArrayUsingCompInto_QS" syntax="SortArrayUsingCompInto_QS(array, results[], func, left, right)">
<stacksize value="11"/>
<referrer name="SortArrayUsingCompInto_Entry"/>
<referrer name="SortArrayUsingCompInto_QS"/>
<param name="array">
</param>
<param name="results">
<paraminfo> [] </paraminfo>
</param>
<param name="func">
</param>
<param name="left">
</param>
<param name="right">
</param>
</member>
As you can see, it causes recursion.
Could you please fix that?
Re: Sort multi-dimensional arrays (enums supported) -
Slice - 01.03.2013
What ****** said. Additionally, this makes Pawn unable to determine the maximum stack/heap size.
To assure you won't run into issues, you should the stack/heap size with the "#pragma dynamic" directive.
AW: Sort multi-dimensional arrays (enums supported) -
Mellnik - 01.03.2013
Oh, didn't know about that QuickSort. I knew, that bounded recursion is ok but the "unknown, due to recursion" message is rather ugly.
Already using "#pragma dynamic", hope 8000 is enough for sorting few (small) arrays + the for other script parts.
AW: Sort multi-dimensional arrays (enums supported) -
Mellnik - 01.03.2013
Would be very awesome ****** - maybe (if Slice agrees) you could add md-sort to YSI. Would be a nice enlargement for YSI.
AW: Sort multi-dimensional arrays (enums supported) -
Mellnik - 02.03.2013
I mean this include. Anyway, what about making this include GPL?
AW: Sort multi-dimensional arrays (enums supported) -
Mellnik - 02.03.2013
No no i mean making md-sort GPL and then porting the structure.
Btw, why isn't it possible to use "goto"?
Re: Sort multi-dimensional arrays (enums supported) -
Programie - 03.03.2014
Quote:
Originally Posted by [HLF]Southclaw
Programie: what are the actual errors/warnings? You can set the compiler to ignore certain warnings but you should fix them instead of hide from them!
|
They are all "tag mismatch" warnings.
Код:
X:\GitHub\SAMPRacing\includes\grgserver\functions\LoadCommands.inc(49) : warning 229: index tag mismatch (symbol "g_commands")
X:\GitHub\SAMPRacing\includes\grgserver\functions\LoadCommands.inc(49) : warning 213: tag mismatch
X:\GitHub\SAMPRacing\includes\grgserver\functions\LoadCommands.inc(49) : warning 213: tag mismatch
Line 49 of LoadCommands.inc:
Код:
SortDeepArray(g_commands, String:E_COMMAND_NAME);
Re: Sort multi-dimensional arrays (enums supported) -
[ESC]Walter_Wolf - 18.04.2014
I am trying to sort an enum by two columns using the 'SortArrayUsingComparator()' function, but something is not right.
I put the test code to pastebin here:
http://pastebin.com/iEjKvGx4
The OnScriptInit stops executing when it reaches the sort function. Did I do something wrong with the comparator? or what?
thanks
EDIT: looks like I made an infinite loop somehow. I get this message on "function crash"
Код:
Script[gamemodes/comparator2.amx]: Run time error 3: "Stack/heap collision (insufficient stack size)
Re: Sort multi-dimensional arrays (enums supported) -
Luis- - 27.04.2014
For some reason, this include crashes my compiler, any reason why?
Re: Sort multi-dimensional arrays (enums supported) -
Luis- - 28.04.2014
I'm using the Pawno compiler. It just seems to crash when I include the script.
Re: Sort multi-dimensional arrays (enums supported) -
Luis- - 28.04.2014
Last night.