Author Topic: How do I incorporate '\n' into an abbreviation?  (Read 5850 times)

Offline SimbaSpirit

  • Single posting newcomer
  • *
  • Posts: 6
How do I incorporate '\n' into an abbreviation?
« on: October 19, 2008, 05:52:21 pm »
I'm trying to make this abbreviation
cini (ctrl+j) = cin.ignore( numeric_limits <streamsize> ::max(), '\n' );

However, whenever I save my work, shut down the program, then reopen it I get
cini (ctrl+j) =
cin.ignore( numeric_limits <streamsize> ::max(), '
' );


How do I get C::B to actually insert the \n instead of evaluating it?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: How do I incorporate '\n' into an abbreviation?
« Reply #1 on: October 19, 2008, 07:55:16 pm »
cini (ctrl+j) = cin.ignore( numeric_limits <streamsize> ::max(), '\n' );
I guess you already tried escaping - alias '\\n'???
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 SimbaSpirit

  • Single posting newcomer
  • *
  • Posts: 6
Re: How do I incorporate '\n' into an abbreviation?
« Reply #2 on: October 20, 2008, 02:25:19 am »
Yeah I should have made another post saying I already tried that.

cin.ignore( numeric_limits <streamsize> ::max(), '\\n' );

becomes

cin.ignore( numeric_limits <streamsize> ::max(), '\
' );

At the moment I have replaced the n with a pipe, but this workaround would be a real pain in a larger template
« Last Edit: October 20, 2008, 02:30:40 am by SimbaSpirit »

Offline SimbaSpirit

  • Single posting newcomer
  • *
  • Posts: 6
Re: How do I incorporate '\n' into an abbreviation?
« Reply #3 on: October 20, 2008, 06:16:19 am »
Has anyone else made this work before?
Any other ideas?

Offline SimbaSpirit

  • Single posting newcomer
  • *
  • Posts: 6
Re: How do I incorporate '\n' into an abbreviation?
« Reply #4 on: October 22, 2008, 04:44:32 am »
Bump

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: How do I incorporate '\n' into an abbreviation?
« Reply #5 on: October 22, 2008, 02:42:53 pm »
Bump
I already had a look into and might have found the reason. I just don't have time for this now, but I am aware of the issue. Anyways: Please file a bug report at BerliOS so it does not get lost.
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