Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Editing environment variables
icon9.gif  Editing environment variables [message #660563] Sat, 19 March 2011 13:56 Go to next message
Johnny Rosenberg is currently offline Johnny RosenbergFriend
Messages: 4
Registered: March 2011
Location: Sweden
Junior Member

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... Very Happy

[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 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

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 Go to previous messageGo to next message
Johnny Rosenberg is currently offline Johnny RosenbergFriend
Messages: 4
Registered: March 2011
Location: Sweden
Junior Member

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...

Shocked

I'll try that Eclipse CDT forum thing instead.

Thanks.
Surprised
Re: Editing environment variables [message #661196 is a reply to message #660580] Wed, 23 March 2011 14:28 Go to previous message
Eric Rizzo is currently offline Eric RizzoFriend
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
Previous Topic:Crash No error message
Next Topic:not finding visual class in eclipse 3.6 helios
Goto Forum:
  


Current Time: Mon Sep 23 04:06:47 GMT 2024

Powered by FUDForum. Page generated in 0.08080 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top