Notepad++ escape characters
#1

I recently got a new computer, installed notepadd++ and got it working with .pwn/.inc files after following Slice's tutorial, but I seem to have a problem with the escaped characters which seem to make large chunks of the script "think" it's a string?

Here's a small screenshot of what it is like.


I have no idea how to fix it, i tried re-installing.
Reply
#2

I had this issue after upgrading to Windows 8 from my Windows 7 PC.

Simply re-load the document you're currently in and it works.

By the way, take a peek at the end of your if statement.
Reply
#3

I've reloaded it multiple times yet no avail.

And what is wrong with the if statement?
Reply
#4

you open a quote with ' and then end it with another ' then you have it open again with '

try adding //' at the end of the line
Reply
#5

Ehh, the script was fine on my old laptop.
But anyway, I'll give that a go. "//" after the if statement?


Still grey, and I'll let you know that the script compiles fine.
Reply
#6

There's nothing wrong with the if statement - he is simply escaping the ' character to avoid problems with the compiler detecting it as the end of the string.

if(inputtext[i] == '\'')
... is a perfectly valid check.

By the way, your loop could use some improving instead. Your current code will call strlen() n times where n = strlen(string). This can be reduced to 1 only. The longer your string gets, the more time these strlen() calls will consume.

// Edit: try out inputtext[i] == 27 for the sake of it
Reply
#7

Ahh, derp, didn't realise you said put //', Cessil. Done that and it fixes all the grey but still, how do I fix this.

And yea, Andre, I know that but I made that when I didn't know of it :P

Reply
#8

add \ to the escape character
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)