Dark Bit Factory & Gravity
PROGRAMMING => C / C++ /C# => Topic started by: Clyde on January 16, 2010
-
Hello World,
I wonder if you could help me, I don't suppose any one knows how to add keywords for commands in the express edition of Visual Studio 2008 C++?
Thanks heaps,
Clyde.
-
You need to explain a bit more. Keywords in C are, for instance 'if, while, for' etc. You can't add any of those. Commands, I'm not sure what you mean.
Jim
-
I presume you mean like adding the C++ equivalent of writing Graphics, Print or LoadImage in Blitz Basic?
If so then this is a misconception about programming languages which you will need to learn. They are not actually keywords, they are just functions. Functions which are supplied with the language and so appear to be built into it. Basic languages call these keywords because they are often included by default. Other langauges tend to place these default functions into a standard library that you include. In Java this library is called the Java API, in C# it's .NET and in C++ it's called Standard Library (or C++ Standard Library).
So to add your own keywords you just define them as functions and then import them (which I suspect might be your next question). Is that what you were after?
-
For example, I'd quite fancy having 'ptc_update' with a highlight.
I know how to set the colours for keywords.
I found this information:
Add user defined keywords for syntax highlighting
Why can you set a color for user defined keywords in Tools > Options > Format? Where do you set the keywords? Easy, just create usertype.dat in the sharedide/bin directory that Visual Studio is installed in. Put your keywords in that file, one per line.
but I can't find a directory called sharedide/bin
-
Put usertype.dat in ...\Microsoft Visual Studio.NET\Common7\IDE\
-
Kewl!
Cheers rdc :)