Use of quotation marks in literal by morgossi7a2

VIEWS: 12 PAGES: 2

									Use of quotation marks in literal...


        dcoles 12 posts since
Jul 19, 2001
Hopefully this is a really easy question? How do you tell PSL that the quotation mark is a
real quotation mark and part of the literal string and not the end of the literal string ? Looking
in the PSL Vol 1 in section 2-5 it says:"The backslash rules apply for escaping characters
(such as the backslashor the quotation mark) and for making characters such as new-line or
tab."So from this I would think that the PSL line:x = system("test_command ""beta"" > c:
temp
delta.txt"); should issue the command:test_command "beta" > c:\temp\delta.txt But I get
back "unexpected string constant "beta".What is the something obvious I have missed :?:
Many thanksDerek.



         timo 245 posts since
May 26, 2002 1. Quotation mark ... Feb 12, 2004 3:09 PM

Hi Derek,please use the following command ...x = system("test_command \"beta\" > c:
temp
delta.txt"); The backslash has to be used in front of all escaping characters.Best
regardsTimo



          dcoles 12 posts since
Jul 19, 2001 2. Feb 13, 2004 2:22 AM

Hi Timo,Having re-read the PDF extract in light of your example it all makes perfect sense
now.Many thanksDerek



         lhemeryck 921 posts since
Apr 3, 2003 3. Feb 13, 2004 2:26 AM

Hi Derek,Just a suggestion, but I often declare some variables at the beginning of my code ,
like :nl = "\n";qt = "\"";sl = "/";tb = "\t";bs = "




Generated by Clearspace on 2010-01-08-07:00
                                                                                                 1
Use of quotation marks in literal...


";....Some people find it easier to read.So your code would look like : x =
system("test_command ".qt."beta".qt." > c:".bs."temp".bs."delta.txt"); Just a question of
personal preferences...Regards,




Generated by Clearspace on 2010-01-08-07:00
                                                                                            2

								
To top