Author Topic: How do I create multiple files?  (Read 6009 times)

Offline El roux

  • Single posting newcomer
  • *
  • Posts: 4
How do I create multiple files?
« on: September 25, 2011, 03:44:18 am »
Hi! I'am new to code::blocks!
I can't find a way to create new files fast, like the good ol' ctrl+n.
Let say, i start a projet. I already have the classes I need, say like 15 classes. Going through the file wizard 15*2 (for the .cpp/.hpp) is a pain  :D
Is there a way to just put the wizard file creation on a loop or juste create the file faster?

Edit: I can't seem to slip view with two different fils either... I'am using 10.05.
When using "split view", it slipts to the file I'am already editing. When I'am clicking on another tab, I'am loosing the "split".
« Last Edit: September 25, 2011, 04:18:05 am by El roux »

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: How do I create multiple files?
« Reply #1 on: September 25, 2011, 04:38:01 am »
I am not sure exactly what you want, but you could try the class wizard (File->New->Class...), or if the files already exist, you could add them to the project.

To view multiple files at the same time, simply open up both in separate tabs, then click and drag one of the tabs so that it docks on the edge of the screen.

Offline El roux

  • Single posting newcomer
  • *
  • Posts: 4
Re: How do I create multiple files?
« Reply #2 on: September 25, 2011, 04:44:50 am »
All right! Thanks!
Got it!!

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: How do I create multiple files?
« Reply #3 on: September 25, 2011, 04:47:09 am »
Glad to help.

I forgot to mention:
I can't find a way to create new files fast, like the good ol' ctrl+n.
Ctrl-Shift-N will create a blank file.  (At least in my version it does; the wiki-page says it is just Ctrl-N ??)

Offline El roux

  • Single posting newcomer
  • *
  • Posts: 4
Re: How do I create multiple files?
« Reply #4 on: September 25, 2011, 09:53:04 pm »
Ctrl+shft+n works!
My bad, I could've looked better...! Thanks!

Offline BentFX

  • Multiple posting newcomer
  • *
  • Posts: 18
    • BentFX
Re: How do I create multiple files?
« Reply #5 on: September 27, 2011, 11:52:52 am »
If you've got a WHOLE BUNCH, and you happen to be on Linux you could do something like this in the shell, from your source directory..

Code
mkdir temp
cd temp
touch filename1 filename2 filename3 filename4 filename5
for a in *; do cp $a $a.hpp; mv $a $a.cpp; done
mv * ..
cd ..
rm -r temp

Then you can add them all in C::B with one call to add files...

I know this is really more of a Linux shell trick than a C::B feature. But like I said up front... "If you've got a WHOLE BUNCH" it might prove to be the easiest.
« Last Edit: September 27, 2011, 01:43:22 pm by BentFX »
Whenever I go to Walmart I always request an intrusive pat-down from the greeter. It looks good on his resume, and it makes us all just a little bit safer.