Liberty BASIC Community Forum
« Search Results »

Welcome Guest. Please Login or Register.
Aug 27th, 2014, 1:55pm


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

--Liberty BASIC Resources--
Yahoo Code Repository (source must be included)
Liberty BASIC Community WikiSpace
Liberty Labs
Bay Six Software Forum
Liberty BASIC Home Page

Official Liberty BASIC Support
Liberty BASIC Programmer's Encyclopedia
Liberty BASIC 5 Handbook
Liberty BASIC on Rosetta Code

Search Results

Total results: 10


 1   Liberty BASIC Code / Re: ButtonUp in debug mode  on: Today at 1:22pm
Started by rodsweb | Post by Rod
the drawing program that Alyce posted to the sample files shows just how precise you have to be with event handlers.

You need to look for the button down, button drag and button up precisely in sequence. Liberty runs very quickly so if you are not scripting the event handlers correctly it is easy to stack up a queue of unwanted events.

So OFF is good.

 
  Reply Quote Notify of replies

 2   Liberty BASIC Code / Re: ButtonUp in debug mode  on: Today at 04:30am
Started by rodsweb | Post by rodsweb
Thank you for your assistance.
The problems have arisen only after the program got to be near the 5000 line length, so sample code not an option.

Currently I have overcome the problem by putting a timer in the scan loop at the end of the buttonMove block. After a .1 to 3 second delay (anywhere in the range works), the program is instructed to jump into the routine that handles the buttonUp situation (even though the event has not been detected). This works well with no detrement to user experience. It is not a solution I am happy with.

It does appear that as you say the events are stacking up. I will, when I get time, make the buttonMove block more efficient. I may have to turn off event handling while I process each buttonMove. It does a lot of redrawing work which is noticeably slow in win 7.

That does raise another point that I didn't mention, the problem only occurs with my win 7 machine, XP handles it OK. They both have the same clock speed. I have noticed that the win 7 graphics processing is generally not as smooth as XP, there can be noticeable blanking between redraws. We are definitely going backwards with win's so called "upgrades".

The full program is available on ufastweb.com/Download.htm, the problem occurs when you move the boxes or resize the boxes by right button dragging. (It's sort of OK now because of the timer 'fix').
 
  Reply Quote Notify of replies

 3   Liberty BASIC Code / Re: ButtonUp in debug mode  on: Yesterday at 1:47pm
Started by rodsweb | Post by Rod
In older versions of Liberty if you coded one label after another with no code it would work in the IDE but not when compiled to a .tkn or .exe. But this has been fixed. So unless you are running an old version of Liberty we can discount it IMHO.

Debug mode is certainly different from runtime but we have few bugs or problems reported.

If your program is getting tied in knots we need to consider how events stack up and get handled in a queue.

But as I say unless we have the actual code or an example that shows the problem we are reduced to guessing.

Events can stack up very quickly, some keys generate two events, there are little trip wires to consider. So code of any description would be good.

Can you start extracting just the event code and handler redirection?

 
  Reply Quote Notify of replies

 4   Liberty BASIC Code / Re: ButtonUp in debug mode  on: Yesterday at 11:47am
Started by rodsweb | Post by rodsweb
Interesting.
There would not be any need for labels one after the other unless it fixes the 'can't find problem'

What is the issue you are referring too?
 
  Reply Quote Notify of replies

 5   Liberty BASIC Code / Re: ButtonUp in debug mode  on: Yesterday at 09:44am
Started by rodsweb | Post by Stefan Pendl
If you place one label above another without code in between, you will encounter another known issue.

Bad Code:
[label1]
[label2]
 


Good Code:
[label1]
    dummy = 1
[label2]
 

 
  Reply Quote Notify of replies

 6   Liberty BASIC Code / Re: ButtonUp in debug mode  on: Aug 25th, 2014, 5:57pm
Started by rodsweb | Post by rodsweb
No wait or scan in subs.

If LB can find a [label1] but cannot find the [label] that is on the line above or below it then it is not out of scope.
Scope does not change from one line-instruction to the next, only in sub etc.
In this case the the program is not in a sub etc.

Similarly it is strange that in the buttonmove block (no sub etc involved) and only if in debug mode, that waiting in a wait instruction fails to respond to the buttonup action. However replacing the wait with a continuous scan loop does work.

This may never be resolved but I thought someone may have come across it before.
 
  Reply Quote Notify of replies

 7   Liberty BASIC Code / Re: ButtonUp in debug mode  on: Aug 25th, 2014, 2:27pm
Started by rodsweb | Post by Rod
If the program fails to find a label it is simply out of scope. You must be in a function or sub when the event fires and is handled following a wait or scan statement.

Do you have wait or scan statements inside subs or functions and if so do you turn off all external events prior to entering the function or sub?
 
  Reply Quote Notify of replies

 8   Liberty BASIC Code / Re: ButtonUp in debug mode  on: Aug 25th, 2014, 08:34am
Started by rodsweb | Post by rodsweb
Can't get sample code to replicate problem.
Started to occur in a 5000 line program but only in debug mode. Works fine normally. Debug shows it is hung up on a wait in the buttonmove block, has not responded and branched to the buttonup action block of code.

As I said an endless scan loop instead of wait does work.

An unrelated (possibly) problem is that sometimes the program fails to find a [label]. Putting a different [label2] directly above or below and branching to that instead fixes it.

Perhaps there is a limit to a data stack in debug?
 
  Reply Quote Notify of replies

 9   Liberty BASIC Code / Re: ButtonUp in debug mode  on: Aug 25th, 2014, 03:10am
Started by rodsweb | Post by Rod
If you could show code we might get to the answer. If not print a log of where you have been. So at the start of each handler or code block print a note of where you are, that way you get a to see where the events fire and take you.

I suspect that it is because events happen in sequence and have a priority. So the down press happens prior to the up release and may be taking you somewhere unexpected.
 
  Reply Quote Notify of replies

 10   Liberty BASIC Code / Re: ButtonUp in debug mode  on: Aug 24th, 2014, 05:40am
Started by rodsweb | Post by rodsweb
Just replaced the wait with an endless scan loop:

[debuError]
scan
goto [debuError]

This fixes the problem. Does anyone have any idea why the wait gets lost?
 
  Reply Quote Notify of replies


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