Author Topic: a puzzled question about code format  (Read 5522 times)

Offline juncy

  • Single posting newcomer
  • *
  • Posts: 2
a puzzled question about code format
« on: November 07, 2012, 12:20:02 pm »
Hi guys,
I want to add some project information at the beginning of my .h file.
Of course I set this in the 'Default code' option as follows:
/*****************************************************************************
 * This source file is part of OPTIC                                                                                                       *
 *                                                                                                                                                       *
 *                                                                                                                                                       *
 * This program is free software; you can redistribute it and/or modify it                                             *
 * under the terms of the GNU Lesser General Public License as published by                                       *
 * the Free Software Foundation; either version 3 of the License, or (at                                               *
 * your option) any later version.                                                                                                        *
 *****************************************************************************/

BUT
When I create a .h file, it looks as follows, and I do not know how to deal with this problem.

/*****************************************************************************
 * This source file is part of OPTIC                                         *
 *                                                                           *
 *                                                                           *
 * This program is free software; you can redistribute it and/or modify it   *
 * under the terms of the GNU Lesser General Public License as published by  *
 * the Free Software Foundation; either version 3 of the License, or (at     *
 * your option) any later version.                                           *
 *****************************************************************************/

Any one could help me with it?
Thanks very much!!!

Offline gd_on

  • Lives here!
  • ****
  • Posts: 797
Re: a puzzled question about code format
« Reply #1 on: November 07, 2012, 12:30:04 pm »
You have probably used tab characters to generate your code. Try to use spaces only (or convert automatically tab to spaces).

gd_on
Windows 11 64 bits (23H2), svn C::B (last version or almost!), wxWidgets 3.2.4 (tests with 3.3), Msys2 Compilers 13.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: a puzzled question about code format
« Reply #2 on: November 07, 2012, 12:50:47 pm »
You have probably used tab characters to generate your code.
Wither that, or you use a a non-monospaced font in the editor (i.e. letters don't have the same width).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: a puzzled question about code format
« Reply #3 on: November 07, 2012, 12:57:44 pm »
And please, please use code-tags for any code.
It's more readable and should avoid the use of proportional (not monospaced) fontsm when shown in the browser.