Liberty BASIC Community Forum
« Search Results »

Welcome Guest. Please Login or Register.
May 3rd, 2015, 11:52am


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   Game and Graphic Programming / Re: Cancelling when commands?  on: Today at 10:23am
Started by Daniel Atwill | Post by Daniel Atwill
Thank you guys, I assumed that the section in the graphics commands called "print #handle, "when leftButtonDown"" was all there was about the command and didn't realize/remember the section above it stating this. Sorry about that sad
 
  Reply Quote Notify of replies

 2   Game and Graphic Programming / Re: Cancelling when commands?  on: Today at 09:54am
Started by Daniel Atwill | Post by Alyce Watson
on May 1st, 2015, 11:13am, Daniel Atwill wrote:
Is there any way to cancel all the when commands sent to a graphic control?


Helpfile->graphics commands -> when [event] description.

Quote:
If the expression print #handle, "when event" is used with no branch label designation, then trapping for that event is discontinued.


I wrote a series of tutorials on using graphics commands. If you want just the info that answers your question:

Turning Off Event Trapping

If you want to learn all about trapping events in graphics:
Trapping Mouse and Keyboard Events in Graphics

If you want to learn all about graphics commands:
Graphics Tutorial Series


 
  Reply Quote Notify of replies

 3   Game and Graphic Programming / Re: Cancelling when commands?  on: Today at 07:17am
Started by Daniel Atwill | Post by Colin McMurchie
"but if you guys want more info. I will give it when needed."

What a really interesting response Daniel. In fact we do not need any info at all. Remember that it was you who asked us for help!

Colin
 
  Reply Quote Notify of replies

 4   Game and Graphic Programming / Re: Cancelling when commands?  on: Yesterday at 3:13pm
Started by Daniel Atwill | Post by Daniel Atwill
I'm not expecting people to read my mind, but if you guys want more info. I will give it when needed.
 
  Reply Quote Notify of replies

 5   Liberty BASIC Code / Re: GOTO in a loop  on: Yesterday at 2:39pm
Started by michael gallup | Post by MKnarr
I think exiting a loop without using an exit for will eventually cause stack problems. If there is a possibility that based on some condition I need to exit a loop prematurely I set a flag then then exit the loop. Based on the flag condition when I exit the loop, I go to somewhere else.

Code:
flag=0
    for x=1 to 100
        'Do something
        if x= 76 then
            flag=1
            exit for
        end if
    next
    if flag=1 then goto [print]
    end

    [print]  print x
    end
 

 
  Reply Quote Notify of replies

 6   Liberty BASIC Code / Re: GOTO in a loop  on: Yesterday at 1:47pm
Started by michael gallup | Post by michael gallup
I think that is the solution.. I looked at the documentation on SCAN and it seems to address GOTO forced loops.
Thankyou.
 
  Reply Quote Notify of replies

 7   Game and Graphic Programming / Re: Cancelling when commands?  on: Yesterday at 1:37pm
Started by Daniel Atwill | Post by tsh73
Daniel,
it's really hard to guess what people want from single line of text.

robmcal guessed right.
Rod guessed wrong.
My guess was third different one, obviously wrong - in your case.

Don't get surprised that people cannot read your mind.
 
  Reply Quote Notify of replies

 8   Liberty BASIC Code / Re: GOTO in a loop  on: Yesterday at 1:29pm
Started by michael gallup | Post by tsh73
Without seeing code it is hard to tell.

But if you insert SCAN in a tight loop (GOTO or FOR-NEXT), events will work and trapclose will get called.
 
  Reply Quote Notify of replies

 9   Liberty BASIC Code / GOTO in a loop  on: Yesterday at 1:21pm
Started by michael gallup | Post by michael gallup
Can GOTO cause huge problems if used to make a constant loop before a wait? I have noticed that my programs work like event driven programs until it encounters trapclose [quit] end .
But if I use GOTO to make a loop to the beginning of the program and continue to use it to force line executes like the old basic language, trapclose [quit] wont work and when I want to close the window I need to use Kill basic program. It depending on how long I run it will say that there are multiple instances of the same program running.
I started fresh and it usually says there are 2 instances.
Then I get an error that says that I have exceeded certain limits.
This happened when I tried to make a loop in draws with GOTO and used FOR?NEXT loops to pause the animation. It keeps running but closing such a program structure is a problem.
I fixed the problem later by just removing GOTO and treating the program like its event driven.
WAIT seems to know what it should return to or it knows what is the main control group in the program is.
 
  Reply Quote Notify of replies

 10   Novice / Re: Handle as parameter to SUB  on: Yesterday at 10:02am
Started by francesco | Post by francesco
It works, thank you
 
  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