Adding Quotes to a string (")

Hi I have a code

(1)  Results = Browser("Technology Portal - Home").Page("Google Search").WebElement("results").GetROProperty("innerhtml")

---in Results variable- the value is 5800000

(2)  s_prop24="s.prop24="

-- in s_prop24 variable- the value is s.prop24=

the final result i want s.prop24="5800000"

Can you please help how can concatenate and add quotes?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

enclose result with  chr(34)
s_prop24="s.prop24=""" & Results & """
anju_a_sagarAuthor Commented:
hi hielo,

syntax error: unterminated string constant
CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

there's a missing " at the end of that line. Try:

s_prop24="s.prop24=""" & Results & """"
anju_a_sagarAuthor Commented:
the result is


i want


s_prop24="s.prop24=chr(34) & Results & chr(34)
anju_a_sagarAuthor Commented:

syntax error: unterminated string constant
could you paste the code?
anju_a_sagarAuthor Commented:
I have explained in my question...thats the only code

Mike TomlinsonHigh School Computer Science, Computer Applications, and Mathematics TeachersCommented:
solomonacquah was very close...


    s_prop24 = "s.prop24=" & Chr(34) & Results & Chr(34)
Are you sure you are putting 4 sets of double quotes?
anju_a_sagarAuthor Commented:
its coming up with

Mike TomlinsonHigh School Computer Science, Computer Applications, and Mathematics TeachersCommented:
WHERE and HOW are you displaying your resulting string?...and are you sure that the value in Results doesn't already have quotes around it?
>>the result is
You originally said
"---in Results variable- the value is 5800000"

If that is true, then what I posted above (ID:24871542) will give you:

See example below:
<script  type="text/vbscript">
Dim Results,s_prop24
s_prop24="s.prop24=""" & Results & """"
However, it sounds like Results does NOT equal 5800000. It sounds like 
Results equals "5800000" (with the quotes).
If that is the case, then you need to use:
s_prop24="s.prop24=" & Results 

Open in new window

anju_a_sagarAuthor Commented:
i am using QTP tetsing tool and when i run the script i have made a check point where i can see the value of variable.

I m sure there is no quotations in Results variable value
Mike TomlinsonHigh School Computer Science, Computer Applications, and Mathematics TeachersCommented:
I've never used QTP. you are viewing the value inside some kind of IDE?  This may be the root of the problem as it may be displaying it differently than it is actually represented internally.

How about you display the value FROM WITHIN the Script using a MsgBox?

Something like:

    s_prop24 = "s.prop24=" & Chr(34) & Results & Chr(34)
    WScript.Echo s_prop24

Does it display differently?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
anju_a_sagarAuthor Commented:
Please see the screenshot attached.

The actual values are shown below in the variables.

but even though its shown with double quotes..its not stored with double quotes
anju_a_sagarAuthor Commented:
yes u r the msgbox its showing me the right value..
thanks for the help
i got it..
anju_a_sagarAuthor Commented:
thanks a lot
Mike TomlinsonHigh School Computer Science, Computer Applications, and Mathematics TeachersCommented: the QTP Environment is adding the quotes around the value because it is a String variable.  The quotes are not there internally and they are only being placed there for display purposes in the test environment....  =)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.