HELP!! Scariest bug ever
#6

Yeah that's for a single line statement only, a lot of languages do that.

A multi line statement is usually stricter with requirement for parenthesis.

The compiler might be allowing it, but I would be concerned as to whether it really works as intended lol.

pawn Код:
if(c > 1 && c <= 1 + len)
        {
            licenseplate[c] = numberstr[c - 2];
        }
        else switch(c)
        {
            case 0, 1: licenseplate[c] = random('Z' - 'A') + 'A';
            default: licenseplate[c] = random('9' - '0') + '0';
        }
Your if has only one line statement but has parenthesis, your else has a switch and 2 statements but no parenthesis..... It could be valid but it looks like a bad habit to get into.

I'll take a look.
Reply


Messages In This Thread
HELP!! Scariest bug ever - by Incubator - 15.10.2011, 00:49
Re: HELP!! Scariest bug ever - by GrimR - 15.10.2011, 01:02
Re: HELP!! Scariest bug ever - by Incubator - 15.10.2011, 01:10
Re: HELP!! Scariest bug ever - by GrimR - 15.10.2011, 01:14
Re: HELP!! Scariest bug ever - by Incubator - 15.10.2011, 01:21
Re: HELP!! Scariest bug ever - by GrimR - 15.10.2011, 01:25
Re: HELP!! Scariest bug ever - by Incubator - 15.10.2011, 01:42
Re: HELP!! Scariest bug ever - by GrimR - 15.10.2011, 01:58
Re: HELP!! Scariest bug ever - by GrimR - 15.10.2011, 02:02
Re: HELP!! Scariest bug ever - by Incubator - 15.10.2011, 02:31

Forum Jump:


Users browsing this thread: 1 Guest(s)