Author Topic: running box with parameters  (Read 2126 times)

ronw

  • Community Member
  • Posts: 36
  • Hero Points: 0
running box with parameters
« on: February 03, 2014, 11:30:21 pm »
From the message line, I can run:

box

and the current selection will be wrapped in a comment block.

Looking at box.e, it seems I should be able to run:

box '#ifndef DEBUG' '' '#endif' '' '' '' '' ''

and the selection will be wrapped with "#ifdef DEBUG" and "#endif".

But, I get the error "There are no comment block settings for '#ifdef'"

What am I doing wrong?

ronw

  • Community Member
  • Posts: 36
  • Hero Points: 0
Re: running box with parameters
« Reply #1 on: February 04, 2014, 05:25:13 pm »
I figured it out. I wrote a macro to call box with the "decorations" I want.

Code: [Select]
#include "slick.sh"

_command cond()
{
   parse arg(1) with symbol;
   box("#ifdef " :+ symbol, "", "#endif // " :+ symbol, "", "", "", "");
}

ronw

  • Community Member
  • Posts: 36
  • Hero Points: 0
Re: running box with parameters
« Reply #2 on: February 04, 2014, 05:49:51 pm »
I made an enhanced, second macro:
Code: [Select]
_command conde()
{
   parse arg(1) with symbol;
   box("#ifdef " :+ symbol, "", "#else\n#endif // " :+ symbol, "", "", "", "");
}

Which gave the following result:
Code: [Select]
#ifdef FEATURE
And a paragraph of text for
testing purposes.         
#else)#endif // FEATURE

There is a ")" where I expected the line break.

Looking through box.e, the only possible thing I found to explain this is:
Code: [Select]
s.blc=_UTF8ToMultiByte(s.blc);
Have I found a bug?