SA-MP Forums Archive
error 075: input line too long (after substitutions) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: error 075: input line too long (after substitutions) (/showthread.php?tid=263762)



error 075: input line too long (after substitutions) - Tachibana - 23.06.2011

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.


Re: error 075: input line too long (after substitutions) - [HiC]TheKiller - 23.06.2011

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.


Re: error 075: input line too long (after substitutions) - Tachibana - 23.06.2011

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"?


Re: error 075: input line too long (after substitutions) - [HiC]TheKiller - 23.06.2011

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.


Re: error 075: input line too long (after substitutions) - Tachibana - 23.06.2011

not kinda sure how to put it up tho lol


Re: error 075: input line too long (after substitutions) - [HiC]TheKiller - 23.06.2011

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.


Re: error 075: input line too long (after substitutions) - Sasino97 - 23.06.2011

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);



Re: error 075: input line too long (after substitutions) - Tachibana - 23.06.2011

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


Re: error 075: input line too long (after substitutions) - [HiC]TheKiller - 23.06.2011

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.