Warning: unreachable code.
#1

I made this code for check if is any empty slot used. I made one stock for enter to Database and look if there is any column with the ID, if is empty it break the loop and return the value that found, but it send to me one warning.

I use the break for stop the loop if found one.

pawn Код:
stock ComprobarSlot(SlotLibre)
{
for(new i =0; i < MAX_VEHICLES; i++)
    {
    new solicitud[254];
    format(solicitud, sizeof(solicitud), "SELECT * FROM `vehiculos` WHERE %d");
    mysql_query(mysql, solicitud);
    new columnas, filas;
    cache_get_data(columnas, filas);
    if(!columnas)
    {
    break;
    return SlotLibre;
    }
    }
    return 1;
}
Reply


Messages In This Thread
Warning: unreachable code. - by xHanks - 17.11.2014, 15:55
Re: Warning: unreachable code. - by mjay768 - 17.11.2014, 16:02
Respuesta: Re: Warning: unreachable code. - by xHanks - 17.11.2014, 16:21
Re : Warning: unreachable code. - by Dutheil - 17.11.2014, 16:26
Re: Re : Warning: unreachable code. - by Kyance - 17.11.2014, 16:38

Forum Jump:


Users browsing this thread: 1 Guest(s)