Normal Topic Display a quotation mark in a MSGBOX? (Read 710 times)
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Display a quotation mark in a MSGBOX?
Mar 30th, 2007 at 2:56pm
Print Post Print Post  
I'd like to put a quote into a message box.  Is there a way to flag " so that Sesame doesn't think it's part of the syntax?
  

**
Captain Infinity
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Display a quotation mark in a MSGBOX?
Reply #1 - Mar 30th, 2007 at 2:58pm
Print Post Print Post  
Hello Scott,

You will need to use @Chr() to create the Quote.

Code
Select All
@MsgBox("And then he said " + @Chr(34) + "Wow" + @Chr(34), "", "Cool huh?") 



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Display a quotation mark in a MSGBOX?
Reply #2 - Mar 30th, 2007 at 2:59pm
Print Post Print Post  
Super, thanks!
  

**
Captain Infinity
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Display a quotation mark in a MSGBOX?
Reply #3 - Mar 31st, 2007 at 1:17am
Print Post Print Post  
This may not be "proper" coding (and I'm probably going to hear about too Smiley), but I have found it a lot quicker to type two double quotes instead of "+ @Chr(34) +" each time I want quotes in @Msg, @MsgBox, @PromptForUserInput, etc.


You can use this code:
@Msg("This is how you can use ""two"" double quotes instead of ""@Chr(34)"".")

To produce this message:
This is how you can use "two" double quotes instead of "@Chr(34)".

Just remember when a double quote is at the beginning or end of a text string, you will actually be using three of them. Two to create the quote, and one to signify the end of the text string like this:
@Msg("""This entire sentence is enclosed in quotes.""")

The result will look like this:
"This entire sentence is enclosed in quotes."
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged