[RESOLVED] Parenthesis in String?
Hi, I'm trying to make a string use parenthesis ( "(" and ")" ), but for each one it returns: null (for the parenthesis)
How can I get this to work?
These are examples of codes I've tried so far:
Code:
public lpr as string = chr(40).toString()
public rpr as string = chr(41).toString()
...
public string1 as string = lpr & " " & rpr
(Didn't work, returned a space.)
Code:
public string1 as string = "( )"
(Didn't work, returned a space.)
Code:
public lpr as string = "("
public rpr as string = ")"
...
public string1 as string = lpr & " " & rpr
(Didn't work, returned a space.)
And then I tried reading from text files that had those characters. Each one only returned a space.
How can I get this to work?
Thanks,
-Arightwizard
Re: Parenthesis in String?
What do you mean it returned a space? those last two examples do work.... what are you doing to check the string afterwards that's causing a space to be returned? you should end up with a string 3 characters long.
-tg
Re: Parenthesis in String?
That is most unusual. There's nothing special about parentheses so it should be no different from doing
public string1 as string = "a a"
Re: Parenthesis in String?
@techgnome:
Sorry, forgot that part
Later I'm using string1 in a "sendkeys.send".
So it would be
Code:
public string1 as string = "( )"
sendkeys.send(string1)
(No, I am not making any sort of 'bot'.)
Re: Parenthesis in String?
Try this
Public string1 as string = chr(40) & " " & chr(41)
Re: Parenthesis in String?
Quote:
Originally Posted by
koolsid
Try this
Public string1 as string = chr(40) & " " & chr(41)
Still returned a space.
Re: Parenthesis in String?
Quote:
I'm using string1 in a "sendkeys.send".
That does make rather a large difference.
If you are using sendkeys you need to enclose the characters in braces... ie "{(} {)}"
Re: Parenthesis in String?
Quote:
public string1 as string = "( )"
sendkeys.send(string1)
sendkeys.send("( )") '<~~ What is this supposed to do?
Re: Parenthesis in String?
Quote:
Originally Posted by
keystone_paul
That does make rather a large difference.
If you are using sendkeys you need to enclose the characters in braces... ie "{(} {)}"
Ohhhhhhhhhhhhhhhhhhhhhhhhh. Thanks, it worked.
-Arightwizard
*marking as resolved*