Author |
Topic: LB: TRAPCLOSE does not work correctly in text wind (Read 860 times) |
|
RNBW
Full Member
member is offline
Gender:
Posts: 106
|
|
LB: TRAPCLOSE does not work correctly in text wind
« Thread started on: Sep 30th, 2015, 10:25am » |
|
A bug (actually a known bug!) has been identified in the LB Conforum yesterday.
The following code ignores the user's instruction in the Confirm box. The work around is to open "for window as" instead of "for text as".
The code: Code:
nomainwin
open "Trapclose bug" for text as #w
#w "!trapclose [ask]"
wait
[ask]
confirm "Close the window?"; answer$
if answer$ = "yes" then
close #w
end
end if
wait
This is NOT a bug using LBB. The code works.
Yet another star for LBB!!!
|
|
Logged
|
|
|
|
tsh73
Full Member
member is offline
Gender:
Posts: 210
|
|
Re: LB: TRAPCLOSE does not work correctly in text
« Reply #1 on: Sep 30th, 2015, 12:15pm » |
|
I really wonder how it could be a bug in LBB, if LB & LBB does not share any codebase? You are not expecting LB bugs manifest in C# or FORTRAN, aren't you?
|
« Last Edit: Sep 30th, 2015, 12:19pm by tsh73 » |
Logged
|
|
|
|
Richard Russell
Administrator
member is offline
Posts: 1348
|
|
Re: LB: TRAPCLOSE does not work correctly in text
« Reply #2 on: Sep 30th, 2015, 3:40pm » |
|
on Sep 30th, 2015, 12:15pm, tsh73 wrote:I really wonder how it could be a bug in LBB, if LB & LBB does not share any codebase? You are not expecting LB bugs manifest in C# or FORTRAN, aren't you? |
|
LB and LBB could share a 'bug', if the origin lies in some behaviour of the Windows API. For example, I think both at one time shared a common problem if the font of a listbox or combobox was changed (the horizontal scroll range wasn't correctly adjusted). Considering that the Close button is very much a feature of Windows, you should perhaps not be so dismissive of the possibility of the bug affecting LBB.
But otherwise a shared bug would have to be a coincidence, or result from me having deliberately copied a 'bug' in the interests of compatibility (as I did with the LL, UR and LR button anchors).
Richard.
|
|
|
|
RNBW
Full Member
member is offline
Gender:
Posts: 106
|
|
Re: LB: TRAPCLOSE does not work correctly in text
« Reply #3 on: Sep 30th, 2015, 7:39pm » |
|
on Sep 30th, 2015, 12:15pm, tsh73 wrote:I really wonder how it could be a bug in LBB, if LB & LBB does not share any codebase? You are not expecting LB bugs manifest in C# or FORTRAN, aren't you? |
|
No I wasn't expecting a bug, because I'm sure if it had been a bug in BBC Basic Richard Russell would have corrected it long ago, or as he stated in his post, it had been deliberate to maintain compatibility.
The reason I posted was simply to make the point that the code worked in LBB, whereas it didn't in LB.
|
|
Logged
|
|
|
|
tsh73
Full Member
member is offline
Gender:
Posts: 210
|
|
Re: LB: TRAPCLOSE does not work correctly in text
« Reply #4 on: Oct 1st, 2015, 07:26am » |
|
RNBW, such kind of bugs - "plainly don't work in LB" - is really not an issue for LB programmer, at all. You run at it once - it clearly don't work - you just do it some other way, ever after.
|
|
Logged
|
|
|
|
RNBW
Full Member
member is offline
Gender:
Posts: 106
|
|
Re: LB: TRAPCLOSE does not work correctly in text
« Reply #5 on: Oct 1st, 2015, 07:29am » |
|
on Oct 1st, 2015, 07:26am, tsh73 wrote:RNBW, such kind of bugs - "plainly don't work in LB" - is really not an issue for LB programmer, at all. You run at it once - it clearly don't work - you just do it some other way, ever after. |
|
On that we agree!
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline
Posts: 1348
|
|
Re: LB: TRAPCLOSE does not work correctly in text
« Reply #6 on: Oct 1st, 2015, 08:28am » |
|
on Oct 1st, 2015, 07:26am, tsh73 wrote:Such kind of bugs ... is really not an issue for LB programmer, at all. You run at it once - it clearly don't work - you just do it some other way, ever after. |
|
So, if I understand correctly, you are saying that a bug is never important so long as there is a workaround? I cannot agree with that!
Admittedly it does seem that Carl shares your opinion, since only a small proportion of the bugs documented at the LB Bug Tracker Wiki were fixed when LB was updated from 4.04 to 4.5.0.
All I can say is that my attitude to software support is completely different. LBB is officially discontinued, but I still feel obliged to fix any significant bugs (whether there is a workaround or not).
Richard.
|
|
Logged
|
|
|
|
tsh73
Full Member
member is offline
Gender:
Posts: 210
|
|
Re: LB: TRAPCLOSE does not work correctly in text
« Reply #7 on: Oct 1st, 2015, 09:03am » |
|
Quote:you are saying that a bug is never important so long as there is a workaround? |
|
No. I meant that - bug that makes thing clearly don't working is not a big issue because progammer will not use bugged construction in a program. But surely - it does limit effective language programmer can use, and it is bad. Having workaround is a nice option, but having working thing much better yet.
As for my attitude, I have thing posted in a wall: "A programmer should never, ever work on new code if they could instead be fixing bugs (Joel Spolsky)". I may be not living up to it but still
As for Carl's attitude I really have no idea (
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline
Posts: 1348
|
|
Re: LB: TRAPCLOSE does not work correctly in text
« Reply #8 on: Oct 1st, 2015, 11:07am » |
|
on Oct 1st, 2015, 09:03am, tsh73 wrote:"A programmer should never, ever work on new code if they could instead be fixing bugs (Joel Spolsky)". |
|
Good maxim! I don't always live up to it either, but I try.
Richard.
|
|
Logged
|
|
|
|
|