QTP - quotes in VBScript

QTP - quotes in VBScript

Today I found an interesting question on Ankur Jain's blog.
The question was simple - how to display quotation marks (") in QTP?

There two ways to do that:
  1. Double the quotes (""):
    MsgBox "#1: ""QTP - QuickTest Professional"""
    Use 2 double quotation marks to include a quote character in the string.
    So, the result is:

  2. Use ANSI character code - Chr(34):
    MsgBox "#2: " & Chr(34) & "QTP - QuickTest Professional" & Chr(34)
    Since, the ANSI code if quotation mark = 34, we can use Chr function.
    The result is:


Related articles:


--
Dmitry Motevich

2 comments:

Kashyap said...
This comment has been removed by the author.
Abhinav Vaid said...

I was just wondering as to what's so special about QTP in the current code. The code is written in vbs for Windows Operating System & by all means it should work whether you have the QTP or not.
Am I missing something.