News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Settings-editor-default code

Started by twilliam, March 06, 2012, 01:06:23 AM

Previous topic - Next topic

twilliam

On the pull down menu Settings and then Editor and then "Default Code", would you explain how this is intended to be used please?

ollydbg

Quote from: twilliam on March 06, 2012, 01:06:23 AM
I have created "default code" in Settings-Editor
What is the exact step you did? I can't understand your idea.

BTW: It looks like your need to use the project wizard to create a hello world project.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Jenna

Quote from: twilliam on March 06, 2012, 01:06:23 AM
On the pull down menu Settings and then Editor and then "Default Code", would you explain how this is intended to be used please?
Did you read the note below the textbox ?
Quote from: Settings -> Editor... -> Default codeThe text you enter here, will appear on every new file (of the selected file-type) you create...

Jenna

Quote from: jens on March 06, 2012, 10:13:02 AM
Quote from: twilliam on March 06, 2012, 01:06:23 AM
On the pull down menu Settings and then Editor and then "Default Code", would you explain how this is intended to be used please?
Did you read the note below the textbox ?
Quote from: Settings -> Editor... -> Default codeThe text you enter here, will appear on every new file (of the selected file-type) you create...

By the way, you can use variables here, see: http://wiki.codeblocks.org/index.php?title=Variable_expansion

twilliam

Yes I did "read the note below the textbox" but it's not working that way.  When I open a new project
all I get in the CPP is:
#include <iostream>

using namespace std;

int main()
{
    cout << "Hello world!" << endl;
    return 0;
}
which is NOT the text I put in Default Code, again I ask "what am i doing wrong?"


Quote from: jens on March 06, 2012, 10:23:06 AM
Quote from: jens on March 06, 2012, 10:13:02 AM
Quote from: twilliam on March 06, 2012, 01:06:23 AM
On the pull down menu Settings and then Editor and then "Default Code", would you explain how this is intended to be used please?
Did you read the note below the textbox ?
Quote from: Settings -> Editor... -> Default codeThe text you enter here, will appear on every new file (of the selected file-type) you create...

By the way, you can use variables here, see: http://wiki.codeblocks.org/index.php?title=Variable_expansion



oBFusCATed

I guess the problem is that using a project wizard you don't create the file manually, thus the default code handler doesn't trigger.
What happens if you create a new file manually (with ctrl+shift+n or file-> new -> empty file)?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

twilliam

Yes, that worked, you solved the mystery, thank for the help!!

Quote from: oBFusCATed on March 06, 2012, 02:48:50 PM
I guess the problem is that using a project wizard you don't create the file manually, thus the default code handler doesn't trigger.
What happens if you create a new file manually (with ctrl+shift+n or file-> new -> empty file)?