Results 1 to 9 of 9

Thread: [RESOLVED] Parenthesis in String?

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2009
    Posts
    47

    Resolved [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
    The following statements are true. The following statement is false. The first statement is true.

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    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"

  4. #4

    Thread Starter
    Member
    Join Date
    Aug 2009
    Posts
    47

    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'.)
    The following statements are true. The following statement is false. The first statement is true.

  5. #5
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Parenthesis in String?

    Try this

    Public string1 as string = chr(40) & " " & chr(41)
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  6. #6

    Thread Starter
    Member
    Join Date
    Aug 2009
    Posts
    47

    Re: Parenthesis in String?

    Quote Originally Posted by koolsid View Post
    Try this

    Public string1 as string = chr(40) & " " & chr(41)
    Still returned a space.
    The following statements are true. The following statement is false. The first statement is true.

  7. #7
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    Re: Parenthesis in String?

    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 "{(} {)}"

  8. #8
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Parenthesis in String?

    public string1 as string = "( )"
    sendkeys.send(string1)
    sendkeys.send("( )") '<~~ What is this supposed to do?
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  9. #9

    Thread Starter
    Member
    Join Date
    Aug 2009
    Posts
    47

    Re: Parenthesis in String?

    Quote Originally Posted by keystone_paul View Post
    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*
    The following statements are true. The following statement is false. The first statement is true.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width