LB Booster
General >> General Board >> Trace command
http://lbb.conforums.com/index.cgi?board=general&action=display&num=1424982669

Trace command
Post by Alincon on Feb 26th, 2015, 7:31pm

Is there a trace command in LBB, like the one in LB4?
I would really like to use it to find the problem in my 'include' program.

r.m.
Re: Trace command
Post by Richard Russell on Feb 26th, 2015, 8:47pm

on Feb 26th, 2015, 7:31pm, Alincon wrote:
Is there a trace command in LBB, like the one in LB4? I would really like to use it to find the problem in my 'include' program.

Firstly, I would suggest that to aid debugging you temporarily remove the 'include' statement and instead paste the contents of the included file there. The program will run exactly the same, but you gain the advantage that the lines will all have different numbers.

But to get back to your question, yes LBB has a trace statement which works in a similar way to that in LB. Basically TRACE 0 and TRACE 2 work the same, but TRACE 1 behaves differently. In LBB TRACE 1 will list the line numbers, as they are executed, to the mainwin.

Richard.
Re: Trace command
Post by Alincon on Feb 27th, 2015, 01:05am

Okay the trace 2 is working, i'm getting used to the way the LBB debug process works, but I'm having trouble with the FILES statement in LBB.

My data has 10 department folders, some section folders for each department, and some people files in each section

Code:
files randomPath$, info$(    
	 fc = val(info$(0, 1))    ' folder count
     for cf = 1 to fc
        foldName$ = info$(cf, 0)
        files foldName$, info2$(
        fc2 = val(info2$(0,1))
        for cf2 = 1 to fc2
            fold2Name$ = info2$(cf2,0)
            files fold2Name$, typ$, info3$(
            fc3 = val(info3$(0,0))  'file count
              for cf3 = 1 to fc3
                x$ = info3$(cf3,0)
                if (right$(x$,3) = "sal" or right$(x$,3) = "hly") then
                    y$ = getFldr$(foldName$)
                    z$ = getFldr$(fold2Name$)
                    n = n + 1
                    emps$(n) = tb$(x$,28) + y$ +"\"+ z$ + "\"         
                end if
              next cf3
        next cf2
    next cf
 


There are no files at info$( or info2$

the code in the for-next loop beginning with this line never executes while tracing: (fc3 = 3 in the first section)
for cf3 = 1 to fc3
and the list box is never populated.

When I copy the include program code into the main program in LB4, all works as it is supposed to.

Is the FILES statement used differently in LBB?

r.m.

Re: Trace command
Post by Richard Russell on Feb 27th, 2015, 08:29am

on Feb 27th, 2015, 01:05am, Alincon wrote:
Is the FILES statement used differently in LBB?

No, it should work in an identical fashion. There was of course the issue you reported yourself in January (related to the drive letter being omitted) but that was fixed in LBB v2.86.

In fact the code you listed looks very similar to the code which you reported failing in January! Is this the same issue which has returned despite the fix, or something different coincidentally affecting the same piece of code?

Richard.


Re: Trace command
Post by Alincon on Feb 27th, 2015, 12:41pm

My bad. For some reason, I didn't realize it was the same issue.
But I got to experiment with include, trace and the debugging process.

Please repeat the instructions for upgrading to the latest LBB version. I don't know where 'the usual place' is. Or should I wait for the 'big' upgrade in March?

r.m.

Re: Trace command
Post by Richard Russell on Feb 27th, 2015, 1:54pm

on Feb 27th, 2015, 12:41pm, Alincon wrote:
Or should I wait for the 'big' upgrade in March?

You might as well wait. Barring unforeseen snags, I'm hoping to release it on Sunday (1st March).

Richard.