Author Topic: Adding Keywords to VSC 2008 Express  (Read 6071 times)

0 Members and 1 Guest are viewing this topic.

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Adding Keywords to VSC 2008 Express
« 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.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Adding Keywords to VSC 2008 Express
« Reply #1 on: January 17, 2010 »
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
Challenge Trophies Won:

Offline JL235

  • C= 64
  • **
  • Posts: 71
  • Karma: 9
    • View Profile
    • Play My Code
Re: Adding Keywords to VSC 2008 Express
« Reply #2 on: January 17, 2010 »
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?
Play My Code - build games in your browser!

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Adding Keywords to VSC 2008 Express
« Reply #3 on: January 17, 2010 »
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
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline rdc

  • Pentium
  • *****
  • Posts: 1495
  • Karma: 140
  • Yes, it is me.
    • View Profile
    • Clark Productions
Re: Adding Keywords to VSC 2008 Express
« Reply #4 on: January 17, 2010 »
Put usertype.dat in ...\Microsoft Visual Studio.NET\Common7\IDE\

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Adding Keywords to VSC 2008 Express
« Reply #5 on: January 18, 2010 »
Kewl!
Cheers rdc :)
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won: