SA-MP Forums Archive
Notepad++ escape characters - 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: Notepad++ escape characters (/showthread.php?tid=419756)



Notepad++ escape characters - cosbraa - 02.03.2013

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.


Re: Notepad++ escape characters - Scenario - 02.03.2013

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.


Re: Notepad++ escape characters - cosbraa - 02.03.2013

I've reloaded it multiple times yet no avail.

And what is wrong with the if statement?


Re: Notepad++ escape characters - cessil - 02.03.2013

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


Re: Notepad++ escape characters - cosbraa - 02.03.2013

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.


Re: Notepad++ escape characters - AndreT - 02.03.2013

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


Re: Notepad++ escape characters - cosbraa - 02.03.2013

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




Re: Notepad++ escape characters - cessil - 02.03.2013

add \ to the escape character