This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

[TUT] SourcePawn Scripting - Tips, Basics to Advanced


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
MAGNAT2645
Senior Member
Join Date: Nov 2015
Location: AlliedMods.net
Old 08-20-2021 , 19:00   Re: [TUT] SourcePawn Scripting - Tips, Basics to Advanced
Reply With Quote #11

Quote:
Originally Posted by Dragokas View Post
MAGNAT2645, interesting ability, but IMHO, useless sample =) Can't find where it could be useful. The same can be written by manual string enquoting.
As i said, it's not that useful. You can use it in a macro to join text (and put it without quotes).
Code:
#define ERROR(%0) PrintToServer( "ERROR: " ... #%0 )

int a = 5;
int b = 0;
int c;
if ( b == 0 ) ERROR(Division by zero!);
else          c = a / b;
But, it's better to use quotes for better readability
Code:
#define ERROR(%0) PrintToServer( "ERROR: " ... %0 )
if ( b == 0 ) ERROR( "Division by zero!" );
__________________

Last edited by MAGNAT2645; 08-20-2021 at 19:01.
MAGNAT2645 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 08:54.


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