Home » Newcomers » Newcomers » Editing environment variables
Editing environment variables [message #660563] |
Sat, 19 March 2011 13:56 |
|
I am an absolute beginner, both for programming and using Eclipse.
I have tried to start a very simple project and as I'm very sensitive for details, I immediately have a question of the not so important nature, but still a question.
I did those basic things and now I have one .h file and one .cpp file (which I, by the way, wish was called .c++ instead) with some comments on the top.
In those comments I can see three things: File name, creation date and author name.
Preferences → C/C++ → Code Style → Code Templates → Files:
/*
* ${file_name}
*
* Created on: ${date}
* Author: ${user}
*/
Looks like some kind of environment variables to me, but can I change their default values?
For example, "date" isn't in the format I want and "user" is my user name, but I would prefer my real name, or at least not my user name.
Of course I understand that I can always edit my files manually, so there is no need to suggest that...
[Updated on: Sat, 19 March 2011 14:09] Report message to a moderator
|
|
|
Re: Editing environment variables [message #660568 is a reply to message #660563] |
Sat, 19 March 2011 14:19 |
|
On 2011.03.19 7:56, Johnny Rosenberg wrote:
> I am an absolute beginner, both for programming and using Eclipse.
> I have tried to start a very simple project and as I'm very sensitive
> for details, I immediately have a question of the not so important
> nature, but still a question.
>
> I did those basic things and now I have one .h file and one .cpp file
> (which I, by the way, wish was called .c++ instead) with some comments
> on the top.
>
> In those comments I can see three things: File name, creation date and
> author name.
>
> Preferences → C/C++ → Code Style → Code Templates → Files:
> /*
> * ${file_name}
> *
> * Created on: ${date}
> * Author: ${user}
> */
>
> Looks like some kind of environment variables to me, but can I change
> their default values?
>
> For example, "date" isn't in the format I want and "user" is my user
> name, but I would prefer my real name, or at least not my user name.
>
> Of course I understand that I can always edit my files manually, so
> there is no need to suggest that... :d
Check out the sticky posts at the top of this forum. This is not the
best forum for getting help with Eclipse CDT issues.
|
|
|
Re: Editing environment variables [message #660580 is a reply to message #660568] |
Sat, 19 March 2011 15:56 |
|
I read the sticky posts the first thing I did (tried the best I could anyway; English is not my native langauge). I just didn't think that this has anything to do with CDT. ${date} and the others just looked like environment variables to me, so I just thought that this was something like a "global" Eclipse thing, no matter if I use CDT or something else, but as I am a total beginner, my guess was obviously all wrong, surprise, surprise...
I'll try that Eclipse CDT forum thing instead.
Thanks.
|
|
|
Re: Editing environment variables [message #661196 is a reply to message #660580] |
Wed, 23 March 2011 14:28 |
Eric Rizzo Messages: 3070 Registered: July 2009 |
Senior Member |
|
|
On 3/19/11 11:56 AM, Johnny Rosenberg wrote:
> I read the sticky posts the first thing I did (tried the best I could
> anyway; English is not my native langauge). I just didn't think that
> this has anything to do with CDT. ${date} and the others just looked
> like environment variables to me, so I just thought that this was
> something like a "global" Eclipse thing, no matter if I use CDT or
> something else, but as I am a total beginner, my guess was obviously all
> wrong, surprise, surprise...
>
> 8o
> I'll try that Eclipse CDT forum thing instead.
Johnny, you're correct that the idea of code template variables is not
specific to CDT (C/C++ Development Tools); it's used throughout many
different Eclipse plugins.
For ${user}, it just uses the value of the user.name Java
system property which can be specified when starting Eclipse
(-Duser.name="your name").
I don't think there's any way to change the formatting of most of those
variables, though. You can always remove them from your template
settings if they don't meet your needs; that's what I've always done.
There's a few related bugs, for example:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=75981
https://bugs.eclipse.org/bugs/show_bug.cgi?id=66104
Eric
|
|
|
Goto Forum:
Current Time: Mon Sep 23 04:06:47 GMT 2024
Powered by FUDForum. Page generated in 0.08080 seconds
|