Raised This Month: $ Target: $400
 0% 

register_native natives and ... parameters


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 06-14-2007 , 02:37   Re: register_native natives and ... parameters
Reply With Quote #2

I decided that only integers and strings would be fine, so I tried this. It sort of works, except that the "getarg(i-1,1)" check comes back true for integers. I think that it's dipping into other memory, because when I use two separate integers they both result in the same string being formed. Are there any other ways to differentiate between a string and an int that you know of?

Code:
public func_native_handler(a,b,c[],{Float,Sql,Result,_}:...) {     param_convert(3);         static funcid;     if(!funcid) funcid = get_func_id("func");         callfunc_begin_i(funcid);     callfunc_push_int(a);     callfunc_push_int(b);     callfunc_push_str(c);         static buildString[128];     new i, j, argnum = numargs();     for(i=4;i<=argnum;i++)     {         param_convert(i);         if(getarg(i-1,1))         {             j = 0;             while(getarg(i-1,j))             {                 buildString[j] = getarg(i-1,j);                 j++;             }             buildString[j] = 0; // finish string             callfunc_push_str(buildString);         }         else callfunc_push_int(getarg(i-1));     }         callfunc_end(); }
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:44.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode