Liberty BASIC Community Forum
« Not Following 'Wait' Command »

Welcome Guest. Please Login or Register.
Jun 25th, 2017, 05:30am


Rules|Home|Help|Search|Recent Posts|Notification


« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Not Following 'Wait' Command  (Read 301 times)
GaRPMorE
Senior Member
ImageImageImageImage


member is offline

Avatar

"Not everything that counts can be counted, and not everything that can be counted counts." - Albert Einstein


PM


Posts: 288
xx Not Following 'Wait' Command
« Thread started on: Sep 29th, 2015, 5:38pm »

This was posted on the LB Yahoo forum by someone else, some time back. I was unable to explain it, and to my knowledge, no one else addressed the problem.
Code:
    '
    '_NOT_READING_'WAIT'
    '
    nomainwin
    open "Demonstrate Trapclose" for text as #example
    print #example, "!trapclose [close]"
    wait
[close]
    confirm "Close Window?";answer$
    if answer$<>"yes" then
        notice "Not Closing"
        wait
    else
        notice "Closing"
        close #example
        end
    end if
    end
 
User IP Logged

from the world according to GaRPMorE
michael
Guest
xx Re: Not Following 'Wait' Command
« Reply #1 on: Sep 29th, 2015, 7:37pm »

I even tried to make it branch back to top of program with a goto command and it would still close the window.

Perhaps use a different means to close window than trapclose?

Like a quit button in drop down menu?

Or a quit option on menu bar.. that would give you control of what happens if you choose to quit.

OH and another note if you do not use NOMAINWIN and try the program it will close the text window, but when you close main window it will ask if you want to close #example window also..

That seems like an internal basic issue.
« Last Edit: Sep 29th, 2015, 7:44pm by michael » User IP Logged

Chris Iverson
Administrator
ImageImageImageImageImage


member is offline

Avatar

20% Cooler


Homepage PM

Gender: Male
Posts: 2268
xx Re: Not Following 'Wait' Command
« Reply #2 on: Sep 29th, 2015, 7:44pm »

0_o

I think this is a bug, myself.


I ran it under the debugger, single-stepping through it, and the window stayed open.

I ran it under "animated" mode in the debugger, and the window disappeared.

I ran it full speed under the debugger, and the window disappeared.


Now, the reason I say "disappeared" is that, although the window is gone, it hasn't actually been closed by LB. It's been closed by Windows(trying to do a 'notice hwnd(#example)' after the window disappears returns 0), but according to the debugger, the program is still running, and if you try to close the debugger, it asks if you're sure you want to close the window(i.e., some part of LB thinks the window is still open)
User IP Logged

"Do you believe in destiny?" - Pyrrha Nikos, RWBY
"With what wish will your Soul Gem shine?" - Kyubey, Puella Magi Madoka Magica
Jim Hiley
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 198
xx Re: Not Following 'Wait' Command
« Reply #3 on: Sep 29th, 2015, 9:27pm »

If you change it to a normal window, it works as expected so the problem is with windows of type 'text'
Code:
    nomainwin
    open "Demonstrate Trapclose" for window as #example
    print #example, "trapclose [close]"
    wait
[close]
    confirm "Close Window?";answer$
    if answer$<>"yes" then
    notice "Not Closing"
        wait
    else
        notice "Closing"
        close #example
        end
    end if
    end
 


Jim
« Last Edit: Sep 29th, 2015, 9:30pm by Jim Hiley » User IP Logged

tsh73
Board Moderator

member is offline

Avatar

Anatoly (real name)


PM

Gender: Male
Posts: 1661
xx Re: Not Following 'Wait' Command
« Reply #4 on: Sep 30th, 2015, 01:24am »

It is a known bug
TRAPCLOSE does not work correctly in text window

User IP Logged

The existence of bug reports means somebody is using the software and actually cares to report back to you that he is having a problem with it, instead of just deleting it from their hard disk.
(Janusz Marcin Gorycki)
GaRPMorE
Senior Member
ImageImageImageImage


member is offline

Avatar

"Not everything that counts can be counted, and not everything that can be counted counts." - Albert Einstein


PM


Posts: 288
xx Re: Not Following 'Wait' Command
« Reply #5 on: Sep 30th, 2015, 6:03pm »

Quote:
TRAPCLOSE does not work correctly in text window
Seems to me that TRAPCLOSE, by itself works fine. Without the option to WAIT, there is no bug.
User IP Logged

from the world according to GaRPMorE
tooanalytical


member is offline

Avatar




PM


Posts: 1152
xx Re: Not Following 'Wait' Command
« Reply #6 on: Sep 30th, 2015, 8:57pm »

Quote:
It is a known bug
TRAPCLOSE does not work correctly in text window


Quote:
Quote:
TRAPCLOSE does not work correctly in text window
Seems to me that TRAPCLOSE, by itself works fine. Without the option to WAIT, there is no bug.


A workaround may be possible for THIS BUG; Use a regular window but give it a textedit control. I have no code to show for this, only the good guess that the idea should work.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Rules|Home|Help|Search|Recent Posts|Notification

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls