[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Double single quote



Bao,

It seems that many users are confused about this issue.  I hope this
clarifies things.

You simply need to use two single quotes wherever you want to have one
quote inside a literal and then one quote each to start and end the
literal string:

translate($string,'''','''''')  ! the result should be (winner''s
choice)
                  |    || | |
                  |    || | |->one single quote to end the literal
string
                  |    || |-> another two single quotes to include the
second single quote
                  |    ||->two single quotes to include the first single
quote in the literal
                  |    |->one single quote to start the literal string
                  |
                  |->this produces a string containing one single quote



Gina Bencke
Bencke Consulting Corporation
gina@bencke.com

-----Original Message-----
From: Bao Chau Ngo [mailto:bngo@ALDOGROUP.COM]
Sent: Monday, October 25, 1999 10:43 AM
To: Multiple recipients of list SQR-USERS
Subject: Re: Double single quote


Hi Gina.

     I problem is $string contain (winner's choice).  I want to replace
the
single
quote to double single quote.  Here what I want to do

translate($string,'''','''''''') ! the result should be (winner''s
choice)


Thank in advance.



In SQR to embed a quote inside a literal string you must type the quote
twice inside the literal or use a variable containing a quote to build
your string:

Here are some choices:

  move 'winner''s choice' to $string    ! resulting string is winner's
choice

or
  let $quote = chr(39)  ! or let $quote = ''''  (4 single quotes)

  let $string = 'winner' || $quote || 's choice'

SQR has a similar requirement for exclamation points:

  move 'winner''s choice!!' to $string  ! resulting string is winner's
choice!         !

Hope this helps.


Gina Bencke
Bencke Consulting Corporation
gina@bencke.com

-----Original Message-----
From: Bao Chau Ngo [mailto:bngo@ALDOGROUP.COM]
Sent: Monday, October 25, 1999 9:52 AM
To: Multiple recipients of list SQR-USERS
Subject: Double single quote


Hi every Body

     I have a string = winner's choice  I want to put double single
quote
in this.  How I do that.

     Thank in advance.