VB Escape Character?

Post here about scripting and programming for HaloPC (audio, network, ai, etc.)
Post Reply
User avatar
Andrew_b




Socialist

Posts: 4188
Joined: Sat Feb 24, 2007 4:52 pm
Contact:

VB Escape Character?

Post by Andrew_b »

What is the escape character for VB?

I'm using Visual Studio 2008, and when I need to add quotes in a message, it always thinks I'm closing my message.

Here's my code:

Code: Select all

MessageBox.Show("Some one said to me \"Oh Dear\"")
I know this should be simple, but it is not working. :(
ShadowSpartan





Posts: 151
Joined: Mon Jun 13, 2005 12:45 pm

Post by ShadowSpartan »

The only way I know of doing it, is using the Chr() function. Here is what the code will look like.

Code: Select all

MessageBox.Show("Someone said to me " & Chr(34) & "Oh Dear" & Chr(34))
User avatar
Andrew_b




Socialist

Posts: 4188
Joined: Sat Feb 24, 2007 4:52 pm
Contact:

Post by Andrew_b »

Yeah, seems the basic languages are a bit too basic. :P
Domnio





Posts: 199
Joined: Sun Jul 16, 2006 3:44 pm
Location: Earth
Contact:

Post by Domnio »

that should work o.O

Damn that's why I stick to C++ lol

where char is simply a key word integer type and not a function lol
RaVNzCRoFT removed my signature because it contained too many lines of text. I'll read the rules next time.
ImpactPro





Posts: 152
Joined: Sun Sep 28, 2008 12:26 pm
Location: In ur IP Stealing ur Info

Post by ImpactPro »

Escape Character? As in newline? I am not very up on the terms but for C# it is \r\n.
Image
OwnZ joO




Articulatist 500

Posts: 980
Joined: Thu Nov 10, 2005 4:24 pm

Post by OwnZ joO »

No, escape means it signifies that a special character is coming. For example to have quotes inside of a string you would have to do this:
"A wise man once said \"Something\""
If you don't have the escape character in front of the quotes then it would end the string right after said.
ImpactPro





Posts: 152
Joined: Sun Sep 28, 2008 12:26 pm
Location: In ur IP Stealing ur Info

Post by ImpactPro »

ah, I see now.
Image
Post Reply