It is currently Wed Apr 26, 2017 8:21 pm

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  [ 2 posts ] 
Author Message
 Post subject: Synchronous file operation?
Unread postPosted: Wed Oct 19, 2016 2:08 am 

Joined: Sat May 14, 2011 7:43 am
Posts: 355
Location: South Africa, UK & US (Florida)
I didn't know whether to put this in 'questions' or 'enhancements', as perhaps it is already possible? But I can't find out how.
Let us suppose that a BASIC! program is running in a tight (graphics?) loop and encounters a condition that requires a file operation (perhaps a graburl?).
Currently the program is suspended until the file operation completes or times-out.
It would be very valuable if, instead, the program could resume its loop whilst testing a 'flag' which would be set when the file operation either completed or timed-out.
I know this is asking a lot from a single-threading interpreter, but it WOULD be nice!
Any ideas or prospect?

Report this post
 Post subject: Re: Synchronous file operation?
Unread postPosted: Wed Oct 19, 2016 2:57 am 
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5485
Location: Paris, France
Hi Peter,

I suppose you want to continue refreshing the UI while downloading something in the background ?
This would require multi-threading, yes, so not natively supported by BASIC! last not graphic mode, but in fact you can do it in HTML mode !
(I do it in the Compiler, when dexifying for example).

You can launch a javascript code to do some UI operations for a certain time (or until you send an 'end' message to the WebView) and in the meantime run your BASIC! commands...

If your whole program is in graphic mode, maybe you can just switch to HTML only the time of doing this multi-thread operation, then resume the GR mode ?


- Creator of the Android BASIC! Compiler

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

Who is online

Users browsing this forum: No registered users and 1 guest

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: