Check full value of long string in VB6 IDE

I have a string 'sSQL' that contains a very long tsql statement. I need to check what its value is during debugging. Do I usually use? SSQL in the immediate window, but it truncates the first half and gives me only half.

So, is there an alternative way to see the full value using the vb6 sp5 dev environment?

+6
source share
6 answers

If it takes so long, save it in a text file. Have a debugging method:

sub SaveStringToDebugFile(s as string) ... end sub 

and then call it from the direct window:

 SaveStringToDebugFile sSQL 
+4
source

To debug Clipboard.Clear: Clipboard.SetText ssql then paste into notepad.

+14
source

One way is to write a string to a file. You can do this on a single line in the direct window by continuing the line, for example:

 Open "C:\SQL.TXT" For Append As #1: Write #1,sSQL : Close #1 

Note. You will need to change C: \ SQL.Txt to a path that you can write, depending on your OS.

+5
source

While execution is paused at a breakpoint, you can enter an immediate window:

 Debug.Print(sSql) 

; -)

+5
source

Erm, the immediate window is not cropped (except 200 lines of 1023 characters). Have you just tried to press the home key or scroll left?

+2
source

Check the length of the "long" string using Immediate:

 ?len(sSQL) 4221 

knowing the size, you can start getting pieces of string using the Mid function:

 ?Mid(sSQL, 1, 500) ?Mid(sSQL, 500, 1000) ?Mid(sSQL, 1000, 1500) 
0
source

Source: https://habr.com/ru/post/894906/


All Articles