vb special characters

Started by
6 comments, last by Leadorn 20 years, 10 months ago
Im not a vb programmer and im stuck with some simple problems, how do i print \" \n... with writeline outputfile.WriteLine "membersingroup.vbs " & "\"" & Groupname & "\""
Advertisement
i''ve always done it this way, for example:

MsgBox Chr(34) & "test" & Chr(34) & vbCrLf & "test line 2"

where Chr(34) gives you a double quote and the vbCrLf gives you a carriage return linefeed.
Oki thanks.
vbCrLf is good for line breaks. But for double quotes, just use "" -- that''s two double quotes in a row. Its much cleaner:

MsgBox "Your name is ""Joe"" isn''t it?"
MsgBox """Joe"" is your name isn''t it?"
MsgBox "Isn''t your name ""Joe?"""

All are valid in VB.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

quote:Original post by ApochPiQ
vbCrLf is good for line breaks. But for double quotes, just use "" -- that''s two double quotes in a row. Its much cleaner:

MsgBox "Your name is ""Joe"" isn''t it?"
MsgBox """Joe"" is your name isn''t it?"
MsgBox "Isn''t your name ""Joe?"""

All are valid in VB.


are you absolutely certain about that? i no longer have VB installed or i''d check it out, but i used to use it a LOT, and i don''t think that is valid...
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])
Yep, it is valid

"I woke up sweating and clutching my pillow. Thankfully the powerful and reassuring visage of Optimus Prime staring back at me from my pillow case served to ease my frayed nerves. Like the giant robotic father I never had he always knows just what to say" - Gabe, Penny-Arcade

Alexandre Moura
Krez,

Your wrong.

aface.
No, he is right. I used to be an accursed VB programmer before I learned VC.

This topic is closed to new replies.

Advertisement