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)
+--- Thread: error 075: input line too long (after substitutions) (/showthread.php?tid=411657)



error 075: input line too long (after substitutions) - TheCancler - 29.01.2013

I'm trying to figure out the best way to shorten this without disrupting anything and I can't figure it out, I need your help.

pawn Код:
format(string, sizeof(string), "UPDATE Users SET Password='%s',Admin='%d',Money='%d',Skin='%d',Armor='%f',Health='%f',Xpos='%f',Ypos='%f',Zpos='%f',Apos='%f',Interior='%d' WHERE Name='%s'", UserStats[playerid][Password], UserStats[playerid][Admin], UserStats[playerid][Money], UserStats[playerid][Skin], UserStats[playerid][Armor], UserStats[playerid][Health], UserStats[playerid][Xpos], UserStats[playerid][Ypos], UserStats[playerid][Zpos], UserStats[playerid][Apos], UserStats[playerid][Interior], UserStats[playerid][Name]);
Basically I need that split over multiple lines.


Re: error 075: input line too long (after substitutions) - Kitten - 29.01.2013

Use strcat.


Re: error 075: input line too long (after substitutions) - TheCancler - 29.01.2013

I'm having trouble figuring out strcat, never used it before. Been looking for examples of it to no avail.


Re: error 075: input line too long (after substitutions) - u3ber - 29.01.2013

you can use the '\' character to sort-of "glue" strings over multiple lines.

pawn Код:
printf(" hi \
        john"
);
also, because PAWN is free-form,

pawn Код:
{

    new name[] = "helen";
   
    printf("%s",
   
   
   
   
             name);
   

}
is legal. (whitespace characters are ignored by compiler)


Re: error 075: input line too long (after substitutions) - TheCancler - 29.01.2013

^That isn't what I mean, pawn would still see the line as being too long. I fixed the problem with it being too long but know nothing saves to MySQL.

pawn Код:
new string[250] = "UPDATE Users\n SET Password='%s',Admin='%d',Money='%d',Skin='%d',Armor='%f',Health='%f',Xpos='%f',Ypos='%f',Zpos='%f',Apos='%f',Interior='%d',VWorld='%d' WHERE Name='%s'";
    strcat(string," , UserStats[playerid][Password], UserStats[playerid][Admin], UserStats[playerid][Money], UserStats[playerid][Skin], UserStats[playerid][Armor], UserStats[playerid][Health], UserStats[playerid][Xpos], UserStats[playerid][Ypos], UserStats[playerid][Zpos], UserStats[playerid][Apos], UserStats[playerid][Interior], UserStats[playerid][VWorld], UserStats[playerid][Name]");



Re: Re : error 075: input line too long (after substitutions) - TheCancler - 29.01.2013

Quote:
Originally Posted by Robert West
Посмотреть сообщение
pawn Код:
format(string, sizeof(string), "UPDATE Users SET Password='%s',Admin='%d',Money='%d',Skin='%d',Armor='%f',Health='%f',Xpos='%f',\
Ypos='%f',Zpos='%f',Apos='%f',Interior='%d' WHERE Name='%s'"
, UserStats[playerid][Password], UserStats[playerid][Admin], UserStats[playerid][Money],  \
UserStats[playerid][Skin], UserStats[playerid][Armor], UserStats[playerid][Health], UserStats[playerid][Xpos], UserStats[playerid][Ypos], UserStats[playerid][Zpos], \
UserStats[playerid][Apos], UserStats[playerid][Interior], UserStats[playerid][Name]);
error 075: input line too long (after substitutions)

Using \ doesn't make the line any shorter in the compiler's eyes.


Re: error 075: input line too long (after substitutions) - u3ber - 29.01.2013

you clearly don't read well.

open wide,

pawn Код:
format(string, sizeof(string),
    "UPDATE Users SET Password='%s',Admin='%d',Money='%d',Skin='%d',Armor='%f',Health='%f',Xpos='%f',Ypos='%f',Zpos='%f',Apos='%f',Interior='%d' WHERE Name='%s'",
    UserStats[playerid][Password],
    UserStats[playerid][Admin],
    UserStats[playerid][Money],
    UserStats[playerid][Skin],
    UserStats[playerid][Armor],
    UserStats[playerid][Health],
    UserStats[playerid][Xpos],
    UserStats[playerid][Ypos],
    UserStats[playerid][Zpos],
    UserStats[playerid][Apos],
    UserStats[playerid][Interior],
    UserStats[playerid][Name]);
@Robert - you're doing it wrong bro.