Post reply

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.
Name:
Email:
Subject:
Message icon:

Verification:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:
What is the last letter in the word "SlickEdit":
How many LETTERS are in the following? "a1b2c3":
Which number is missing?  "12345689":

shortcuts: hit alt+s to submit/post or alt+p to preview


Topic Summary

Posted by: hensh
« on: March 20, 2020, 06:03:26 PM »

 ;D

thanks
Posted by: Dan
« on: March 20, 2020, 03:36:00 PM »

Because I answered you before I had coffee ;)

In Slick-C, like in C++, \ escapes certain characters in a double quoted string.  For example, "\t" is a tab character.  "\P" is invalid.

Using single quoted strings gets around this.  However, when you have a filename with spaces like that, you still need to double quote them most of the time.
Posted by: hensh
« on: March 20, 2020, 02:42:12 PM »

Worked like charm. Thank you. Any idea why your suggestion was necessary?
Posted by: Dan
« on: March 20, 2020, 02:33:14 PM »

Try this:

shell(_maybe_quote_filename('C:\Program Files\Typora\Typora.exe')' 'p_buf_name,'QA');
Posted by: hensh
« on: March 20, 2020, 02:25:27 PM »

This was the first thing I tried.

Code: [Select]
shell("C:\Program Files\Typora\Typora.exe " p_buf_name,'QA');
The macro does not compile and I get a message stating that there is an illegal character with a blinking cursor appearing between the colon and the backslash.
Posted by: Dan
« on: March 20, 2020, 11:09:38 AM »

Try putting double quotes around C:\Program Files\Typora\Typora.exe  since there are space in it.

If you had this in a variable you could use _maybe_quote_filename() around it.  You still could, but since you have a constant, it's easy enough to just quote.
Posted by: hensh
« on: March 20, 2020, 11:06:43 AM »

The Slick-C code below will not run. However, if Typora.exe is in my PATH, the commented line below works. Why can't Slick-C find 'C:\Program Files\Typora\Typora.exe'? I've tried numerous variations. What am I missing?

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

_command void runtypora() name_info(','VSARG2_READ_ONLY|VSARG2_REQUIRES_EDITORCTL)
{
   if (_no_child_windows()) {
      _message_box("No buffer is open");
      return;
   }
   if (_isno_name(p_DocumentName) || p_buf_name == '') {
      _message_box("No buffer is open");
      return;
   }
   save();
   //shell('Typora ' p_buf_name, 'QA');
   shell('C:\Program Files\Typora\Typora.exe ' p_buf_name,'QA');
}