What is the solution for the long line ?
#1

I got long line error, how to fix it if the error is in a Message Text line ?

pawn Код:
List[playerid] = TextDrawCreate(171.875000, 175.583374, "- dsajklasd mdsal;ds kl;sald ndsladls;akdl jkdjsalkjdksajdkjaskdjskajdlksajdlksa ddksalkd;lsak ddhsaksad l'asd hkldsad 'pidsajlsd ksad hdsasd jdsal' dsa.");
Код:
(8089) : error 075: input line too long (after substitutions)
Reply
#2

LOL, its to long Textdraw,, i should use strcat
Reply
#3

Just put it in a seperate line, you can only get these error if the line is over ~500 char long
Reply
#4

You can break the line after each comma, and/or within the string itself using a backslash (\):

pawn Код:
List[playerid] = TextDrawCreate(171.875000, 175.583374,
    "- dsajklasd mdsal;ds kl;sald ndsladls;akdl jkdjsalkjdksajdkjaskdjskajdlksajdlksa \
    ddksalkd;lsak ddhsaksad l'asd hkldsad 'pidsajlsd ksad hdsasd jdsal' dsa."
);
If the string is still too long, separate them into different parts then join them using strcat.
Reply
#5

Or make per part
Reply
#6

i know what is the meaning of the error, but is there any solution ? or should i make a new variable called "List2[MAX_PLAYERS]" and continue the text here ?
Reply
#7

Quote:

make per part

yes, there any solution of your problem

*MyBadEnglish
Reply
#8

Quote:
Originally Posted by Corekt
Посмотреть сообщение
You can break the line after each comma, and/or within the string itself using a backslash (\):

pawn Код:
List[playerid] = TextDrawCreate(171.875000, 175.583374,
    "- dsajklasd mdsal;ds kl;sald ndsladls;akdl jkdjsalkjdksajdkjaskdjskajdlksajdlksa \
    ddksalkd;lsak ddhsaksad l'asd hkldsad 'pidsajlsd ksad hdsasd jdsal' dsa."
);
Error turns to >>
Код:
(8089 -- 8090) : error 075: input line too long (after substitutions)
Quote:
Originally Posted by Corekt
Посмотреть сообщение
If the string is still too long, separate them into different parts then join them using strcat.
can you please explain more ?
Reply
#9

In that case, divide your string into separate parts then concatenate them together like this. Since the final string won't change in your case, I would suggest making the array the exact length of your string + 1 to avoid wasting unnecessary space (in this case 154).

pawn Код:
new string[154] = "- dsajklasd mdsal;ds kl;sald ndsladls;akdl jkdjsalkjdksajdkjaskdjskajdlksajdlksa";
strcat(string, " ddksalkd;lsak ddhsaksad l'asd hkldsad 'pidsajlsd ksad hdsasd jdsal' dsa.");
List[playerid] = TextDrawCreate(171.875000, 175.583374, string);
https://sampwiki.blast.hk/wiki/Strcat


EDIT: Unless you intend to use a global textdraw (which in that case there's no need for the array), you should be using player textdraws for your player array. Switch to CreatePlayerTextDraw.
Reply
#10

can i make this also if the text still long ?

pawn Код:
new string[154] = "- dsajklasd mdsal;ds kl;sald ndsladls;akdl jkdjsalkjdksajdkjaskdjskajdlksajdlksa";
strcat(string, " ddksalkd;lsak ddhsaksad l'asd hkldsad 'pidsajlsd ksad hdsasd jdsal' dsa.");
strcat(string, " ddksalkd;lsak ddhsaksad l'asd hkldsad 'pidsajlsd ksad hdsasd jdsal' dsa.");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)