It is currently Sat Apr 29, 2017 10:27 am



Welcome
Welcome to rfobasic

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today. **You are not required to provide truthful information to any registration questions. Be whomever you wish to be.!


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: ONBACKKEY and EXIT
Unread postPosted: Fri Apr 07, 2017 3:39 am 
Offline
User avatar

Joined: Sat Dec 08, 2012 2:14 am
Posts: 1128
Location: From Blighty
Should ONBACKKEY and EXIT work like this?

Run this code:-

Code:
ONBACKKEY:
EXIT
BACK.RESUME


I didn't hit the 'back key'. But BASIC! immediately exits... Putting a DO...UNTIL it works, as expected...

Code:
DO
UNTIL 0

ONBACKKEY:
EXIT
BACK.RESUME


With just:-

Code:
ONBACKKEY:
BACK.RESUME


I get 'back key not hit

back.resume'. Message...

What am I missing? I sound perdantic. I'd expect at least the last 2 code examples to behave the same? I suppose it's because you are doing nothing it's better to execute the command? I'm trying to make things crash! Always in a nice way, by the way.

Mog


Report this post
Top
 Profile  
 
 Post subject: Re: ONBACKKEY and EXIT
Unread postPosted: Fri Apr 07, 2017 4:25 am 
Online

Joined: Tue Dec 04, 2012 10:50 am
Posts: 644
Location: UK
Isn't it just because it is just another label and all labels "fall through". Just because you mean it to be executed only on pressing the BACK key does not mean that Basic! knows that...

Mike.


Report this post
Top
 Profile  
 
 Post subject: Re: ONBACKKEY and EXIT
Unread postPosted: Fri Apr 07, 2017 5:48 am 
Offline
User avatar

Joined: Sat Dec 08, 2012 2:14 am
Posts: 1128
Location: From Blighty
Yes, that makes sense Mike, because this code is treated like a label:-

Code:
GOSUB ONBACKKEY

PAUSE 3000
END

ONBACKKEY:
PRINT "Hello."
RETURN


Mog


Report this post
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
suspicion-preferred