If you run this program you will get different results from LB 4.04 and LBB when the window is closed:
Code: call test
wait
[label]
close #w
print "Jumped to the [label] *outside* the subroutine"
wait
sub test
open "Click the close button" for window as #w
#w "trapclose [label]"
exit sub
[label]
close #w
print "Jumped to the [label] *inside* the subroutine"
wait
end sub
LB 4.04 prints "Jumped to the [label] *outside* the subroutine" and LBB prints "Jumped to the [label] *inside* the subroutine".
LBB assumes that the relevant scope for the destination of the trapclose command is what is visible when the command is issued. On the other hand LB 4.04 appears to assume that the relevant scope is what is visible when the window is closed.
The Liberty BASIC docs have nothing to say on this issue. It seems to me that the way LBB behaves is more in keeping with the conventional understanding of 'scope', and it means the destination of the trapclose is determined at compile-time. With LB 4.04, however, the destination is determined at run-time and could actually vary depending on what the program happens to be doing when the window is closed, which strikes me as potentially problematic. However your mileage may vary.
Note that, in this specific case, you can make the program behave the same way on both LB and LBB simply by omitting the label inside the subroutine:
Code: call test
wait
[label]
close #w
print "Jumped to the [label] *outside* the subroutine"
wait
sub test
open "Click the close button" for window as #w
#w "trapclose [label]"
end sub
Richard.