parentheses
#1

Hello, I was wondering how do I remove the {} of the code, and leave only one to open { and } to close, it is currently as follows:
PHP код:
                    if (PlayerInfo[i][pExp] < expamount) {} ///
                    
else
                    {
                    } 
I want to leave like this:

PHP код:
                    if (..?)
                    {
                    } 
Reply
#2

I think you will fuck the script if you do that.
Reply
#3

there are multiple sulutions:
first
Код:
if( !(PlayerInfo[i][pExp] < expamount)) {
    //...
}
second
Код:
if(PlayerInfo[i][pExp] >= expamount) {
    //...
}
Reply
#4

I'd rather use this one:
Код:
if(...)
{
    // ...
}
Reply
#5

Quote:
Originally Posted by Terrorizt
Посмотреть сообщение
I'd rather use this one:
Код:
if(...)
{
    // ...
}
It depends on the condition inside of the if. If condition is simple yea, if condition is better understandable in negated form, use the first solution. Perfomanse is the same, today we have good compilers and they will optimise the code.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)