SA-MP Forums Archive
unknown directive - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: unknown directive (/showthread.php?tid=271755)



unknown directive - Jay. - 25.07.2011

can somebody give me a brief explanation of what the error
"unknown directive" means ?

Because I have something like this

pawn Code:
#===============
And it gives the error unknown directive.
What I am trying to do is make a picture with the colour blue. so I tried
# (the define) thing but it gives a error, obviously.

Thanks


Re: unknown directive - Jay. - 26.07.2011

Sorry for the bump but i've slept over it.
Anyone ?


Re: unknown directive - Simon - 26.07.2011

Any line starting with # is reserved for the compiler directives. The compiler directives are commands that tell the compiler to do a task.

You having the line "#===============" is telling the compiler to execute its internal "===============" command (directive). This command doesn't exist, hence "unknown directive".


Re: unknown directive - Jay. - 26.07.2011

Quote:
Originally Posted by Simon
View Post
Any line starting with # is reserved for the compiler directives. The compiler directives are commands that tell the compiler to do a task.

You having the line "#===============" is telling the compiler to execute its internal "===============" command (directive). This command doesn't exist, hence "unknown directive".
Okay that explains much.
Thanks


But is there an alternative using that # to make blue.
Or should I just use comment lines instead?

Perhaps #define?


Re: unknown directive - Simon - 26.07.2011

As ****** said, you need to be clearer with your request. I'm under the assumption that you're trying to put blue colours in your source code to beautify it?

The blue colour is only an effect created by your editor (assuming you're using Pawno)-- really it's just plain text that's been coloured by your editor. It's not worth putting effort into colouring your code, it will vary from editor to editor and could create unintended side effects (if you manage to hack together a solution).

Stick with comments if you need a bit of colour to improve readability, but don't go to far or else you could decrease readability of your code. You may regret spending time creating some cool coloured art when you have to waste your time scrolling past it everytime you open your script.


Re: unknown directive - HuSs3n - 26.07.2011

#define pattern must start with an alphabetic character


Re: unknown directive - Mean - 26.07.2011

Quote:
Originally Posted by [RonaldO]
View Post
#define pattern must start with an alphabetic character
This, you won't be able to do:
pawn Code:
#define ============
Just use comment lines instead:
pawn Code:
//============