Issue with debugging

axeman69

Member
Joined
Apr 29, 2008
Messages
6
Programming Experience
10+
First of all, I'm a new member and this is my first post. If I overstep any boundries, please let me know. If this should be in another forum, also please let me know.

I'm having an issue debugging a VB program. Here is a code snippet.

Dim cr As String()
While Not fp.EndOfData
Try
cr = fp.ReadFields
strFlags = getFlags(cr(0))
If Left(strFlags, 1) = "Y" Then
moveToFile(cr)
End If
Catch ex As Exception
End Try
End While

If I put the breakpoint on the IF statement, the code stops, and I can step through the code, but If I put the breakpoint on a statement in the moveToFile procedure, it doesn't stop.

Any ideas???
 
Put the breakpoint at the start of the method rather than the call to the method.

If you place your insertion point in moveToFile(cr) and hit Ctrl+B it will put the breakpoint at the function for you (can also do Debug --> New Breakpoint --> Break at Function).
 
Matt,

Thanks for the reply. I tried that already, but, it's still not working. The code ultimately writes lines to another text file. When I step through the code, it works fine, but if I just run it, it doesn't work at all. I'm at a loss, here.

Mark
 
Ok, with the help of an AS/400 RPG Programer, I figured this out.

The program is going after data in an Access database. I was using this code:

strSQL = "SELECT TLW_Cust_ID FROM Cust_Xref_Detail where (MAS200_Cust_ID = '" & strCustID & "')"
cmMMF.CommandText = strSQL
Try

dr = cmMMF.ExecuteReader
strTLWCustID = dr.Item(0).ToString
dr.Close()
Catch ex As Exception

End Try

Although I did not have the dr.read() method invoked. Aparently, the read() method may be implied in debug????? I don't know, but when I inserted the dr.read() method before going after the dr.Item(0).tostring, it works fine.

Thanks for the replies.
 
Back
Top