Raised This Month: $51 Target: $400
 12% 

[SP]| somevar != someconst ? return -7 : null | and got invalid expresion


Post New Thread Reply   
 
Thread Tools Display Modes
Mathias.
Veteran Member
Join Date: Aug 2010
Location: Canada is my city
Old 12-06-2015 , 14:01   Re: [SP]| somevar != someconst ? return -7 : null | and got invalid expresion
Reply With Quote #11

no and why are you so obsess with this kind of typing. just write a line or 2 more and get over it.
Mathias. is offline
fakuivan
Senior Member
Join Date: Nov 2015
Old 12-06-2015 , 14:09   Re: [SP]| somevar != someconst ? return -7 : null | and got invalid expresion
Reply With Quote #12

Quote:
Originally Posted by thecount View Post
You can't use 'return' in an expression like that. Best way to get around this is to, god forbid, use an if statement.
PHP Code:
if(somevar != someconst){ return 7; } 
Great! that makes a lot more sense, Thanks a lot!
fakuivan is offline
fakuivan
Senior Member
Join Date: Nov 2015
Old 12-06-2015 , 14:17   Re: [SP]| somevar != someconst ? return -7 : null | and got invalid expresion
Reply With Quote #13

Quote:
Originally Posted by Black-Rabbit View Post
no and why are you so obsess with this kind of typing. just write a line or 2 more and get over it.
I have like 40 of this checks and I wanted to make it easier to read because the lack of curly braces in an if makes it look inconsistant from a beginners perspective (I wanted to give some code snippets to a friend that has no idea about what sourcepawn is), I am not obsess with it, I just wanted to know if anyone knew how to use it properly in sourcepawn.
fakuivan is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 12-06-2015 , 14:55   Re: [SP]| somevar != someconst ? return -7 : null | and got invalid expresion
Reply With Quote #14

easier to read :'D
Miu is offline
Reply



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 17:41.


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