Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    Mar 2002
    Location
    Australia
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to view content of a long string variable (VB6)

    During run time, I need to check SQL statement which is assigned to string variable strSQL and can be 400 hundreds characters long. When use Watch Window, I can only manage to see max abt 250 characters at Value area, while the end part of the string is trimmed off but only that part is what I m interested in. Can anyone tell me how to view the full content of long string variable?

    Thanks
    David

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: How to view content of a long string variable (VB6)

    You can either temporarily put a statement

    MsgBox strSQL

    in the relevant place(s) in your code, or put a breakpoint there, and type the same statement into the Immediate window when the code pauses.

  3. #3
    Lounger
    Join Date
    Mar 2002
    Location
    Australia
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to view content of a long string variable (VB6)

    Thank you Hans!

  4. #4
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to view content of a long string variable (VB6)

    Use Immediate window and debug.print, either within the code itself, or in the Immediate window directly.

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Marietta, Georgia, USA
    Posts
    296
    Thanks
    9
    Thanked 4 Times in 4 Posts

    Re: How to view content of a long string variable (VB6)

    When I have very long string variables that I need to watch, I create a dummy label control or text box on a form. Then I set the label caption (or text for the text box ) equal to the string via code.
    Rick Groszkiewicz
    Life is too short to drink bad wine (or bad coffee!)

Posting Permissions

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