Recent Posts

Pages: 1 2 [3] 4 5 ... 10
21
I should also mention that

?some_string\c

Works in SlickEdit as long as your regex syntax is configured for Vim syntax. Tools>Options>Editing>Search and set "Regular expression syntax" to Vim.
22
I made the same mistake as you.

When you use ? you need to use ? to terminate the string and then specify the options.

?some_string?i

I tested the above and it works.
23
Slick-C® Macro Programming / Re: Persistent variable
« Last post by wconley on January 15, 2019, 01:13:10 pm »
Dan and Graeme, this sounds perfect. Thank you both very much!!!
24
Slick-C® Macro Programming / Re: Persistent variable
« Last post by Dan on January 15, 2019, 12:50:48 pm »
Hi Dan
You just lost me slightly there.  Do you mean it's easier just to use textBoxDialog and not have the ini file at all?  I did think about textBoxDialog but I wasn't sure if it kept its data through an upgrade and the OP said he already made a form so I thought he would probably want to keep it.

No, just that if the ini isn't found, you could use it to prompt the first time.
25
Slick-C® Macro Programming / Re: Persistent variable
« Last post by Graeme on January 15, 2019, 11:32:54 am »
Hi Dan
You just lost me slightly there.  Do you mean it's easier just to use textBoxDialog and not have the ini file at all?  I did think about textBoxDialog but I wasn't sure if it kept its data through an upgrade and the OP said he already made a form so I thought he would probably want to keep it.

26
SlickEdit® / About the display of References' Bookmarks
« Last post by Ciky_Yin on January 15, 2019, 10:55:44 am »
When I use "Go to References for...",Will display the bookmark in the line that calls the function,How do I close it and no longer display?
27
Slick-C® Macro Programming / Re: Persistent variable
« Last post by Dan on January 15, 2019, 10:46:05 am »
Graeme for the win.  This could be improved slightly by calling textBoxDialog to get the first value... but if they're just entering it once, the ini file should be fine.
28
Slick-C® Macro Programming / Re: Persistent variable
« Last post by Graeme on January 15, 2019, 10:29:11 am »
You can save it to a file with the code below.
On Windows you can read the system environment variable USERNAME with get_env('USERNAME');

Code: [Select]
_command void xsave_user_name(_str username = 'fred')
{
   _str filename = _ConfigPath() :+ 'mydata.ini';

   int temp_view_id;
   int orig_view_id = _create_temp_view(temp_view_id);
   insert_line(username);
   p_window_id = orig_view_id;
   int status = _ini_put_section(filename, 'SectionUserName', temp_view_id);
   if (status) {
      _message_box('Error writing file : ' :+ filename);
   }
}


_command _str xload_user_name()
{
   _str filename = _ConfigPath() :+ 'mydata.ini';
   int tempWID;
   status := _ini_get_section(filename, 'SectionUserName', tempWID);
   if (status)
   {
      //_message_box('Error reading file : ' :+ filename);
      return '';
   }

   origWID := p_window_id;
   p_window_id = tempWID;
   top();
   _str line = '';
   get_line(line);
   p_window_id = origWID;
   // message(line);
   return line;
}



29
Slick-C® Macro Programming / Re: Persistent variable
« Last post by wconley on January 14, 2019, 02:56:17 pm »
Would rather be able to do it just once but first time for each instance of the editor would be okay too.
30
Slick-C® Macro Programming / Re: Persistent variable
« Last post by Dan on January 14, 2019, 02:51:58 pm »
Are you ok with them typing it in the first time each instance of the editor, or want them to do it just once?
Pages: 1 2 [3] 4 5 ... 10