Raised This Month: $32 Target: $400
 8% 

How to pass 'any ...' symbol?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
disawar1
AlliedModders Donor
Join Date: Aug 2011
Location: Russian
Old 09-22-2018 , 14:28   How to pass 'any ...' symbol?
Reply With Quote #1

I would like to avoid VFormat code in Debug. Is there way to pass 'any ...' symbol to DebugEx function?
PHP Code:
void Debug(int bit, const char[] formatany ...)
{
    
// here some code...
    // getting value and passing it to another function

    
static char sFormattedStr[1024];
    
VFormat(sFormattedStrsizeof(sFormattedStr), format3);

    
DebugEx(bitvaluesFormattedStr);
}

void DebugEx(int bitint value, const char[] formatany ...)
{
    
// do VFormat here!

__________________

Last edited by disawar1; 09-22-2018 at 14:29.
disawar1 is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 09-23-2018 , 00:24   Re: How to pass 'any ...' symbol?
Reply With Quote #2

Unfortunately, the only way to directly work with varargs is if it's for a native where you can use the GetNative* functions. Even then, you'd have to use Call_StartFunction and friends to deal with an unknown number of arguments.
Fyren is offline
Reply


Thread Tools
Display Modes

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 14:27.


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