Quote:
Originally Posted by Cannary2048
What do you mean optimize? btw try
pawn Код:
if (6 < strlen(inputtext) < 24)
|
That wouldn't work... and IF statement is like a real life scenario?
Example: I have more "dodo"'s than you.
pawn Код:
if(IceCubeDodoCount > CannaryDodoCount)
You can't if a 3 statements like that as it's not an if your saying:
if 6 is more than string text is more than 24. What would that even return: Example
pawn Код:
if(IceCubeDodoCount > CannaryDodoCount < OtherDudeDodoCount)
Now there are 3 statements 2 checks, however... there no way you can if that statement.
Even if it did work you last operator would have to be '>' not '<' to prevent it exceeding it's return. The original code posted, is the most optimised way. However you shouldn't concentrate too much on cosmetic looks of coding or small optimisations like this. Modern compilers are likely going to poop out the same code anyway, concentrate more on code readability unless you code runs slowly.
As you progress in your journey of learning Pawn, your coding style naturally becomes better anyway. Remember, always compare an if to a real life scenario if your not sure.