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

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.
Reply
#2

Use strcat.
Reply
#3

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

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)
Reply
#5

^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]");
Reply
#6

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.
Reply
#7

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)