error 075: input line too long (after substitutions)
#1

pawn Код:
(541) error 075: input line too long (after substitutions)
And the pawn of it is:

pawn Код:
new str[512];
                format( str , sizeof(str) , "UPDATE `sa-mp`.`propertyinfo` SET `E_X`='%f', `E_Y`='%f', `E_Z`='%f', `E_INT`='%d', `E_VW`='%d', `I_X`='%f', `I_Y`='%f', `I_Z`='%f', `I_INT`='%d', `CASHBOX`='%d', `TYPE`='%d', `LEVEL`='%d',\
                `NAME`='%s', `OWNER`='%s',`CO_OWNER`='%s', `SOLD`='%d', `LOCK`='%d',\
                `ALARM`='%d', `PRICE`='%d' WHERE `ID`='%d'"
,propertyInfo[propertyid][E_X],propertyInfo[propertyid][E_Y],propertyInfo[propertyid][E_Z],propertyInfo[propertyid][E_INT],propertyInfo[propertyid][E_VW],
                propertyInfo[propertyid][I_X],propertyInfo[propertyid][I_Y],propertyInfo[propertyid][I_Z],
        propertyInfo[propertyid][I_INT],propertyInfo[propertyid][CASHBOX],propertyInfo[propertyid][TYPE],propertyInfo[propertyid][LEVEL],propertyInfo[propertyid][NAME],propertyInfo[propertyid][OWNER],propertyInfo[propertyid][CO_OWNER],propertyInfo[propertyid][SOLD],
        propertyInfo[propertyid][LOCK],propertyInfo[propertyid][ALARM],propertyInfo[propertyid][PRICE], propertyid );
        mysql_query(str);
        //print(str);
What I only know is that the problem is caused because of the lenght? I tried chaning "str" to bigger but no luck.
Reply
#2

It normally means that your actual line is too long, make it into more lines. If it's not that, you will need to use two or more format strings and then format those separate strings into one larger string.
Reply
#3

Quote:
Originally Posted by [HiC]TheKiller
Посмотреть сообщение
It normally means that your actual line is too long, make it into more lines. If it's not that, you will need to use two or more format strings and then format those separate strings into one larger string.
Tied doing more lines didnt work. Could you help me out with that "more format strings"?
Reply
#4

Quote:
Originally Posted by Tachibana
Посмотреть сообщение
Tied doing more lines didnt work. Could you help me out with that "more format strings"?
Well, in that I meant doing something like this:

pawn Код:
new str[2][256], largestr[512];
format(str[0], sizeof(str[0]), "%s.....", Varables...);
format(str[1], sizeof(str[1]), "%d.....", More Varables...);
format(largestr, sizeof(largestr), "%s %s", str[0], str[1]);
Not 100% sure that it will make a difference, worth a try though.
Reply
#5

not kinda sure how to put it up tho lol
Reply
#6

pawn Код:
new str[6][150], lstr[512];
format(str[0], sizeof(str[0]), "UPDATE `sa-mp`.`propertyinfo` SET `E_X`='%f', `E_Y`='%f', `E_Z`='%f', `E_INT`='%d'", propertyInfo[propertyid][E_X],propertyInfo[propertyid][E_Y],propertyInfo[propertyid][E_Z],propertyInfo[propertyid][E_INT]);
format(str[1], sizeof(str[1]), "`E_VW`='%d', `I_X`='%f', `I_Y`='%f', `I_Z`='%f',", propertyInfo[propertyid][E_VW], propertyInfo[propertyid][I_X],propertyInfo[propertyid][I_Y],propertyInfo[propertyid][I_Z]);
format(str[2], sizeof(str[3]), "`I_INT`='%d', `CASHBOX`='%d', `TYPE`='%d', `LEVEL`='%d',", propertyInfo[propertyid][I_INT],propertyInfo[propertyid][CASHBOX],propertyInfo[propertyid][TYPE],propertyInfo[propertyid][LEVEL]);
format(str[2], sizeof(str[4]), "`NAME`='%s', `OWNER`='%s',`CO_OWNER`='%s', `SOLD`='%d',", propertyInfo[propertyid][NAME],propertyInfo[propertyid][OWNER],propertyInfo[propertyid][CO_OWNER],propertyInfo[propertyid][SOLD],);
format(str[2], sizeof(str[5]), "`LOCK`='%d', `ALARM`='%d', `PRICE`='%d' WHERE `ID`='%d'", propertyInfo[propertyid][LOCK],propertyInfo[propertyid][ALARM],propertyInfo[propertyid][PRICE], propertyid);
format(lstr, sizeof(lstr), "%s %s %s %s %s", str[0], str[1], str[2], str[3], str[4], str[5]);
mysql_query(lstr);
Not really efficient, it would be better to add to have 2 strings and just add onto the large string every time but you get the sort of idea.
Reply
#7

Quote:
Originally Posted by [HiC]TheKiller
Посмотреть сообщение
pawn Код:
new str[6][150], lstr[512];
format(str[0], sizeof(str[0]), "UPDATE `sa-mp`.`propertyinfo` SET `E_X`='%f', `E_Y`='%f', `E_Z`='%f', `E_INT`='%d'", propertyInfo[propertyid][E_X],propertyInfo[propertyid][E_Y],propertyInfo[propertyid][E_Z],propertyInfo[propertyid][E_INT]);
format(str[1], sizeof(str[1]), "`E_VW`='%d', `I_X`='%f', `I_Y`='%f', `I_Z`='%f',", propertyInfo[propertyid][E_VW], propertyInfo[propertyid][I_X],propertyInfo[propertyid][I_Y],propertyInfo[propertyid][I_Z]);
format(str[2], sizeof(str[3]), "`I_INT`='%d', `CASHBOX`='%d', `TYPE`='%d', `LEVEL`='%d',", propertyInfo[propertyid][I_INT],propertyInfo[propertyid][CASHBOX],propertyInfo[propertyid][TYPE],propertyInfo[propertyid][LEVEL]);
format(str[2], sizeof(str[4]), "`NAME`='%s', `OWNER`='%s',`CO_OWNER`='%s', `SOLD`='%d',", propertyInfo[propertyid][NAME],propertyInfo[propertyid][OWNER],propertyInfo[propertyid][CO_OWNER],propertyInfo[propertyid][SOLD],);
format(str[2], sizeof(str[5]), "`LOCK`='%d', `ALARM`='%d', `PRICE`='%d' WHERE `ID`='%d'", propertyInfo[propertyid][LOCK],propertyInfo[propertyid][ALARM],propertyInfo[propertyid][PRICE], propertyid);
format(lstr, sizeof(lstr), "%s %s %s %s %s", str[0], str[1], str[2], str[3], str[4], str[5]);
mysql_query(lstr);
Not really efficient, it would be better to add to have 2 strings and just add onto the large string every time but you get the sort of idea.
You made a little mistake, you formatted 3 times the third string, with the lenght of the others, the right code is

pawn Код:
new str[5][150], lstr[512];
format(str[0], sizeof(str[0]), "UPDATE `sa-mp`.`propertyinfo` SET `E_X`='%f', `E_Y`='%f', `E_Z`='%f', `E_INT`='%d'", propertyInfo[propertyid][E_X],propertyInfo[propertyid][E_Y],propertyInfo[propertyid][E_Z],propertyInfo[propertyid][E_INT]);
format(str[1], sizeof(str[1]), "`E_VW`='%d', `I_X`='%f', `I_Y`='%f', `I_Z`='%f',", propertyInfo[propertyid][E_VW], propertyInfo[propertyid][I_X],propertyInfo[propertyid][I_Y],propertyInfo[propertyid][I_Z]);
format(str[2], sizeof(str[2]), "`I_INT`='%d', `CASHBOX`='%d', `TYPE`='%d', `LEVEL`='%d',", propertyInfo[propertyid][I_INT],propertyInfo[propertyid][CASHBOX],propertyInfo[propertyid][TYPE],propertyInfo[propertyid][LEVEL]);
format(str[3], sizeof(str[3]), "`NAME`='%s', `OWNER`='%s',`CO_OWNER`='%s', `SOLD`='%d',", propertyInfo[propertyid][NAME],propertyInfo[propertyid][OWNER],propertyInfo[propertyid][CO_OWNER],propertyInfo[propertyid][SOLD],);
format(str[4], sizeof(str[4]), "`LOCK`='%d', `ALARM`='%d', `PRICE`='%d' WHERE `ID`='%d'", propertyInfo[propertyid][LOCK],propertyInfo[propertyid][ALARM],propertyInfo[propertyid][PRICE], propertyid);
format(lstr, sizeof(lstr), "%s %s %s %s", str[0], str[1], str[2], str[3], str[4]);
mysql_query(lstr);
Reply
#8

Quote:
Originally Posted by [GF]Sasino97
Посмотреть сообщение
You made a little mistake, you formatted 3 times the third string, with the lenght of the others, the right code is

pawn Код:
new str[5][150], lstr[512];
format(str[0], sizeof(str[0]), "UPDATE `sa-mp`.`propertyinfo` SET `E_X`='%f', `E_Y`='%f', `E_Z`='%f', `E_INT`='%d'", propertyInfo[propertyid][E_X],propertyInfo[propertyid][E_Y],propertyInfo[propertyid][E_Z],propertyInfo[propertyid][E_INT]);
format(str[1], sizeof(str[1]), "`E_VW`='%d', `I_X`='%f', `I_Y`='%f', `I_Z`='%f',", propertyInfo[propertyid][E_VW], propertyInfo[propertyid][I_X],propertyInfo[propertyid][I_Y],propertyInfo[propertyid][I_Z]);
format(str[2], sizeof(str[2]), "`I_INT`='%d', `CASHBOX`='%d', `TYPE`='%d', `LEVEL`='%d',", propertyInfo[propertyid][I_INT],propertyInfo[propertyid][CASHBOX],propertyInfo[propertyid][TYPE],propertyInfo[propertyid][LEVEL]);
format(str[3], sizeof(str[3]), "`NAME`='%s', `OWNER`='%s',`CO_OWNER`='%s', `SOLD`='%d',", propertyInfo[propertyid][NAME],propertyInfo[propertyid][OWNER],propertyInfo[propertyid][CO_OWNER],propertyInfo[propertyid][SOLD],);
format(str[4], sizeof(str[4]), "`LOCK`='%d', `ALARM`='%d', `PRICE`='%d' WHERE `ID`='%d'", propertyInfo[propertyid][LOCK],propertyInfo[propertyid][ALARM],propertyInfo[propertyid][PRICE], propertyid);
format(lstr, sizeof(lstr), "%s %s %s %s", str[0], str[1], str[2], str[3], str[4]);
mysql_query(lstr);
Duhh this gives me 4 errors of:

pawn Код:
(540) : error 001: expected token: "]", but found "-integer value-"
(540) : warning 215: expression has no effect
(540) : error 001: expected token: ";", but found "]"
(540) : error 029: invalid expression, assumed zero
(540) : fatal error 107: too many error messages on one line
Line 540
pawn Код:
format(str[0], sizeof(str[0]), "UPDATE `sa-mp`.`propertyinfo` SET `E_X`='%f', `E_Y`='%f', `E_Z`='%f', `E_INT`='%d'", propertyInfo[propertyid][E_X],propertyInfo[propertyid][E_Y],propertyInfo[propertyid][E_Z],propertyInfo[propertyid][E_INT]);
and it seems fine
Reply
#9

Not sure if it was meant to be
pawn Код:
str[5][150]
//Or
str[150][5]
If it's not that, one of your variables are wrong.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)