Re: native functions that returns arrays

Skip to first unread message


Apr 22, 2013, 10:21:13 PM4/22/13
to pawnscript
It seem there's no pointer conscept in pawn. You may
pass a array to get the resoult of the function.
intersect(src1[], src2[],result[])

I am new to pawn too.And I also want to know is there
an easy way to pass datas between native and vm.

May be you should way for answer form others.


======== 2013-04-23 06:59:24 ========

Today's Topic Summary
native functions that returns arrays [1 Update]
native functions that returns arrays Apr 22 09:18AM -0700


I have found that there is way in PAWN to define native function that
returns arrays, as example here:
*native intersect[Rect](src1[Rect], src2[Rect])*
But I am not able to find way how to implemented it. From observing
standard callbacks:
*int AMXAPI amx_Callback(AMX *amx, cell index, cell *result, const cell
It seems to me that there is no way, since the native function returns only
one cell, that is stored into results.

Can you advice? Shall I re implement this callback or is there correct
standard way.

Thx Jan


Apr 24, 2013, 7:14:35 AM4/24/13

that is how I do it exactly right now. But it would be nicer to have it as a direct output :-)
If I found out, I will post it here. I probably try to modify dispatcher.

Dne úterý, 23. dubna 2013 4:21:13 UTC+2 杨标(Vinge) napsal(a):

Alex Cole

May 5, 2013, 12:32:50 PM5/5/13
PAWN doesn't have pointers, but it does have addresses.  I suspect you allocate memory on the heap then return that address as a single cell from the native.
Reply all
Reply to author
0 new messages