"\" in textdraws
#1

Hi, sorry if the post is already requested, but i haven't found nothing about this.

Now to the problem:

I have created with the useful Zamaroht's "Textdraw Editor" a speedometer graphic (as you can see in the screen)



But when i must insert the code into pawn, i reach this error code:

Код:
C:\Users\Ruben\Desktop\SGW!\filterscripts\ce.pwn(48) : error 037: invalid string (possibly non-terminated string)
C:\Users\Ruben\Desktop\SGW!\filterscripts\ce.pwn(48) : warning 215: expression has no effect
C:\Users\Ruben\Desktop\SGW!\filterscripts\ce.pwn(48) : error 001: expected token: ";", but found ")"
C:\Users\Ruben\Desktop\SGW!\filterscripts\ce.pwn(48) : error 029: invalid expression, assumed zero
C:\Users\Ruben\Desktop\SGW!\filterscripts\ce.pwn(48) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Code:
Textdraw1 = TextDrawCreate(618.000000, 325.000000, "\");

The code is referring at the "\" (in the picture, is in the right)
Because in fact when i put Textdraw1 = TextDrawCreate(618.000000, 325.000000, "someothertext"); it works!




Solutions?
Reply
#2

Because \ is also used as an escaping character
Reply
#3

Show the line where the error is.
Reply
#4

Quote:
Originally Posted by Pinguinn
Посмотреть сообщение
Because \ is also used as an escaping character
So why in the editor is possible?

The problem is the pawn editor? If I use another editor such as "SAMP editor"?
Reply
#5

@MP2: He did show it.

Pinguinn is right, the backslash is an escaping character. To tell the compiler you actually want to use it, you need to type it twice:

pawn Код:
Textdraw1 = TextDrawCreate(618.000000, 325.000000, "\\");
Reply
#6

EDIT: Thanks Hiddos!
I have fixed.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)