callfunc_push_str(string, true) only return single letter
Why? Here's my code....in an API where the core asks an extension for a string, gives it the string buffer and max length, then the function returns it in that buffer. But it only seems to be returning a single letter. Does anyone know why?
Core calling function..... PHP Code:
Code:
I know it runs properly because the prints are displayed and the first letters are correct. Its just a single letter, not the whole string. I've been diong it mostly with PC_SILENT, which shows that Silent Run IS in the input string. But then when it returns and goes back to the core the string only shows as 'S'. Is this limitations in the engine or bugs in my code? NOTE: i used a hardcoded 15 as the length for debug purposes. Wondering if charsmax was causing the problem. It wasn't. Just haven't changed it back yet. Before anyone tries to "improve" it. |
Re: callfunc_push_str(string, true) only return single letter
When you code an api, don't use call_func, use dynamic natives.
call_func_X are more when you wan't to add some support to an existing plugin that has already been released. |
Re: callfunc_push_str(string, true) only return single letter
Quote:
|
Re: callfunc_push_str(string, true) only return single letter
Dynamic natives are more efficient, and appropriated for what you are doing. Forget callfunc !!
|
Re: callfunc_push_str(string, true) only return single letter
Quote:
EDIT: This is how i set up the dynamic native (my original design) but it didn't do what i wished for it to, though did what i needed successfully. PHP Code:
|
Re: callfunc_push_str(string, true) only return single letter
Quote:
Code:
Code:
Code:
|
Re: callfunc_push_str(string, true) only return single letter
Last arg of your forward is not required, you should only pass the string, not the array size.
|
Re: callfunc_push_str(string, true) only return single letter
Quote:
|
Re: callfunc_push_str(string, true) only return single letter
Quote:
EDIT: But still, how would i have multiple extensions sending strings back to the core to be displayed? I'll update my first post's code to show more of what i'm doing. Quote:
EDIT: Connor talking about in your example, hornet. Which, no, you don't need to send lengths because it is constant and you're not manipulating a string. But if you're working with actual non-static strings, yes, i do believe you should send lengths in params. |
Re: callfunc_push_str(string, true) only return single letter
Quote:
Quote:
Quote:
|
| All times are GMT -4. The time now is 15:05. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.