Code::Blocks Forums

User forums => Help => Topic started by: twilliam on March 06, 2012, 01:06:23 am

Title: Settings-editor-default code
Post by: 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?
Title: Re: Settings-editor-default code
Post by: ollydbg on March 06, 2012, 01:47:04 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.
Title: Re: Settings-editor-default code
Post by: Jenna on March 06, 2012, 10:13:02 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 code
The text you enter here, will appear on every new file (of the selected file-type) you create...
Title: Re: Settings-editor-default code
Post by: Jenna on March 06, 2012, 10:23:06 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 code
The 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 (http://wiki.codeblocks.org/index.php?title=Variable_expansion)
Title: Re: Settings-editor-default code
Post by: twilliam on March 06, 2012, 02:37:23 pm
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?"


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 code
The 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 (http://wiki.codeblocks.org/index.php?title=Variable_expansion)


Title: Re: Settings-editor-default code
Post by: 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)?
Title: Re: Settings-editor-default code
Post by: twilliam on March 07, 2012, 02:19:01 am
Yes, that worked, you solved the mystery, thank for the help!!

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)?