return as float
#1

why cant i return as float?

pawn Код:
stock FLOAT(mysql_field[])
{
    new string[128];
    mysql_fetch_field_row(string, mysql_field);
    return floatstr(string); //warning 213: tag mismatch
}
Reply
#2

pawn Код:
stock FLOAT(mysql_field[])
{
    new string[128];
    mysql_fetch_field_row(string, mysql_field);
    return _:floatstr(string); //warning 213: tag mismatch
}
Reply
#3

I'm curious, what does the _: mean, that you added?
Reply
#4

it removes the tag

e.g new Float:hello

_:hello removes the Float: tag
Reply
#5

pawn Код:
stock Float:FLOAT(mysql_field[])
{
    new string[128];
    mysql_fetch_field_row(string, mysql_field);
    return floatstr(string); //warning 213: tag mismatch
}
Reply
#6

How can I learn how to work with MySQL?

I found a lot of topics with ready systems, but I wanted tutorials =/
Reply
#7

Quote:
Originally Posted by Donya
Посмотреть сообщение
it removes the tag

e.g new Float:hello

_:hello removes the Float: tag
Thanks I'd never seen this covered in any documentation I read, are there more things like this?
Reply
#8

Quote:
Originally Posted by ******
Посмотреть сообщение
You do if the stock returns a tagged result and appears later in code than the first place it is used.
Well that's true.

Quote:
Originally Posted by Famalamalam
Посмотреть сообщение
Thanks I'd never seen this covered in any documentation I read, are there more things like this?
https://sampforum.blast.hk/showthread.php?tid=216730
Reply
#9

Quote:
Originally Posted by Famalamalam
Посмотреть сообщение
Thanks I'd never seen this covered in any documentation I read, are there more things like this?
Sure there are. Basic are
_ - default, used for integers
Float - decimal number
bool - false/true
At all there is no end of PAWN tags, that because you always can create your own tags.
Reply
#10

Quote:
Originally Posted by CyberGhost
Посмотреть сообщение
pawn Код:
stock FLOAT(mysql_field[])
{
    new string[128];
    mysql_fetch_field_row(string, mysql_field);
    return _:floatstr(string); //warning 213: tag mismatch
}
thanks works

Quote:
Originally Posted by 0x5A656578
Посмотреть сообщение
pawn Код:
stock Float:FLOAT(mysql_field[])
{
    new string[128];
    mysql_fetch_field_row(string, mysql_field);
    return floatstr(string); //warning 213: tag mismatch
}
gives me errors...

anyway it is fixed :d
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)