LowerToUpper.
#1

Hi guys

Have anyone the function "LowerToUpper", like:

pawn Код:
#define UpperToLower(%1) for ( new ToLowerChar; ToLowerChar < strlen( %1 ); ToLowerChar ++ ) if ( %1[ ToLowerChar ]> 64 && %1[ ToLowerChar ] < 91 ) %1[ ToLowerChar ] += 32
Thanks.
Reply
#2

pawn Код:
#define LowerToUpper(%1) for ( new ToUpperChar; ToUpperChar < strlen( %1 ); ToUpperChar ++ ) if ( %1[ ToUpperChar ]> 97 && %1[ ToUpperChar ] < 122 ) %1[ ToUpperChar ] -= 32
Reply
#3

I do not know why some people want to push everything into a macro. If it contains the keywords if, else, for, while, etc, then by all means use a function!

pawn Код:
toUpper(text[])
{
    for(new i = strlen(text); i > 0; i--)
    {
        if('a' <= text[i] <= 'z')
            text[i] |= 0x20;
     }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)