tips
[Top] [All Lists]

Using double quotes in REALbasic text

To: "REALbasic Tips" <realbasic-tips at lists dot realsoftware dot com>
Subject: Using double quotes in REALbasic text
From: Geoff Perlman <geoff at realsoftware dot com>
Date: Wed, 04 Apr 2001 17:20:10 -0500
As you know, when you use a string in your REALbasic code, REALbasic knows it's a string because it's surrounded by double quotes. But what do you do
if you want the string or part of the string to include double quotes?

You can use the Char function to add a quote into your string. Here's an
example:

msgbox chr(34)+"It works!"+chr(34)+" is what he said."

But there's an easier way. You can simply surround the item with an extra set of double quotes. Here's the same string as above using double quotes:

msgbox """It works!"" is what he said."

There is a set of double quotes around the entire string and a set of double
quotes around  'It works!' as well. There result is:

"It works!" is what he said.

And it indeed does.

Thanks to Owen Yamauchi for this tip.
--

Geoff Perlman
President & CEO
REAL Software, Inc.
http://www.realsoftware.com
mailto:geoff at realsoftware dot com
Phone: 512-263-1233 x711
Fax:   512-263-1441


 - - - - - - - - - -
Got a useful tip to share? Send it to us at:
REALbasic-tips at lists dot realsoftware dot com dot
For list commands, send "Help" in the body of a message to
<requests at lists dot realsoftware dot com>


<Prev in Thread] Current Thread [Next in Thread>
  • Using double quotes in REALbasic text, Geoff Perlman <=