Results 1 to 3 of 3

Thread: string problem

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 1999
    Location
    u.s.a
    Posts
    127

    Post

    How do I give a string varable a value that contains parenthasis ?
    for example:

    dim str as string
    str= "the man said "hello" "
    (this gives a compile error).
    Thanks.
    Danab.

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    sString = "The Man Said, " & Chr(34) & "Hello" & Chr(34)

    ------------------
    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]
    Certified AllExperts Expert

  3. #3
    Frenzied Member
    Join Date
    Jan 2000
    Location
    Bellevue, WA, USA
    Posts
    1,357

    Post

    I think you mean quotes instead of parenthesis...Here's another way...

    Code:
    Option Explicit
    
    Private Sub Form_Load()
    
        Dim TestString As String
        
        Me.Show
        
        TestString = "He said ""Hello"""
        
        Print TestString
        
    End Sub
    Hope that helps.

    ~seaweed

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