Re: native functions that returns arrays

88 views
Skip to first unread message

杨标(Vinge)

unread,
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.
Like:
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
Group: http://groups.google.com/group/pawnscript/topics
native functions that returns arrays [1 Update]
native functions that returns arrays
kre...@princip.cz Apr 22 09:18AM -0700

Hi,

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
*params)*
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


              ven....@gmail.com
               2013-04-23

kre...@princip.cz

unread,
Apr 24, 2013, 7:14:35 AM4/24/13
to pawns...@googlegroups.com
Hi,

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

unread,
May 5, 2013, 12:32:50 PM5/5/13
to pawns...@googlegroups.com
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
Forward
0 new messages