It is currently Thu Jun 29, 2017 9:05 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  [ 29 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: Hi (from Indonesia)
Unread postPosted: Sun Sep 21, 2014 9:34 pm 
Offline

Joined: Sat Sep 20, 2014 10:17 pm
Posts: 389
May be someone know differences of this script,coz the result are same (for me):
----------
Print "Hi"
Do
Until 0
Onbackkey:
Exit
----------

And

----------
Print "Hi"
----------

TQ...


Report this post
Top
 Profile  
 
 Post subject: Re: Hi (from Indonesia)
Unread postPosted: Sun Sep 21, 2014 9:49 pm 
Offline

Joined: Sat Sep 20, 2014 10:17 pm
Posts: 389
I remembered w/ old BASIC like GW BASIC,we can read/write memory(RAM).
Can I do it w/ RFO BASIC?
TQ...


Report this post
Top
 Profile  
 
 Post subject: Re: Hi (from Indonesia)
Unread postPosted: Sun Sep 21, 2014 11:01 pm 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5545
Location: Paris, France
No, you can find samples (or rather a tutorial) at www.rfobasic.com (without a dash) and you can download the QuickAPK at www.rfo-basic.com
Have you tried going to the website before posting ? :|

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Report this post
Top
 Profile  
 
 Post subject: Re: Hi (from Indonesia)
Unread postPosted: Sun Sep 21, 2014 11:33 pm 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5545
Location: Paris, France
There is no thread in RFO-BASIC! so you have to use a main DO..UNTIL loop to program your socket server.
Please study the sample f32_tcp_ip_sockets.bas provided with BASIC!

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Report this post
Top
 Profile  
 
 Post subject: Re: Hi (from Indonesia)
Unread postPosted: Sun Sep 21, 2014 11:37 pm 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5545
Location: Paris, France
It is not possible to read and write memory in the Android system. So it is not possible in RFO-BASIC! too.
But you use pointers to refer objects in memory (pointers are memory addresses).
What would be your main goal anyway?

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Report this post
Top
 Profile  
 
 Post subject: Re: Hi (from Indonesia)
Unread postPosted: Sun Sep 21, 2014 11:44 pm 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5545
Location: Paris, France
fitriantoh wrote:
May be someone know differences of this script,coz the result are same (for me):
----------
Print "Hi"
Do
Until 0
Onbackkey:
Exit
----------

And

----------
Print "Hi"
----------

TQ...

The second program prints Hi then exits immediately.
The first program goes in an infinite loop that can only be broken by pressing the Back key. Then the OnBackKey: special label traps the press of the Back key and exits cleanly.

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Report this post
Top
 Profile  
 
 Post subject: Re: Hi (from Indonesia)
Unread postPosted: Sun Sep 21, 2014 11:58 pm 
Offline

Joined: Sat Sep 20, 2014 10:17 pm
Posts: 389
@Nicolas:
Sorry, I think www.rfobasic.com (without a dash) and www.rfo-basic.com are same.
We can use read/write memory for various using like change interrupt number,keyboard cache,change text and color in monitor,etc.
For the scripts,when I run the result are same (for 2nd script wasn't immediately go to BASIC!'s editor).BTW,I use ES File Explorer to create BAS file, edit and run it.


Report this post
Top
 Profile  
 
 Post subject: Re: Hi (from Indonesia)
Unread postPosted: Mon Sep 22, 2014 5:50 am 
Offline

Joined: Wed Oct 03, 2012 9:53 am
Posts: 2802
Location: Colorado, U.S.
You don't create threads in BASIC!, it creates the threads for you. You use commands like SOCKET.SERVER.CREATE, SOCKET.SERVER.CONNECT, and SOCKET.CLIENT.CONNECT. Those commands create threads as needed. There are several pages in the manual describing socket commands.

APK: If you like using Eclipse, you can follow the instructions in Appendix D of the manual, "Building a Standalone Application". Or you can do what almost everybody does and use mougino's QuickAPK, which runs on a Windows PC. If you prefer Linux, you can use the APK builder that Stefano P wrote.

- Marc


Report this post
Top
 Profile  
 
 Post subject: Re: Hi (from Indonesia)
Unread postPosted: Mon Sep 22, 2014 11:37 am 
Offline

Joined: Wed Oct 03, 2012 9:53 am
Posts: 2802
Location: Colorado, U.S.
fitriantoh wrote:
BTW,I use ES File Explorer to create BAS file, edit and run it.
Okay. That explains the "problem", which is really not a problem at all. You're jumping into the middle instead of starting at the beginning.

When you are in the Editor, and you load or type a program, and you select "Run" from the Menu, the Editor starts the BASIC! interpreter. When the interpreter is done with the program, you are looking at the Output Console. When you hit the Back key, the Console closes, and you return to the Editor. That is how the BASIC! app was designed to work.

Another way to start a BASIC! program is to build its name into an Android Launcher Shortcut. To see how to do that, read Appendix C of the manual, "Launcher Shortcut Tutorial". You are selecting a file in an Android File Explorer and telling Android to open the file with the BASIC! app. That is like starting a program from a Launcher Shortcut.

When you launch from a Shortcut, or File Explorer, there is no Editor. The BASIC! app starts the interpreter and runs your program. When you are done, you are looking at the Output Console. But when you hit the Back key, closing the Console, you return to Android.

This is how it works when you run your first demo program. It prints "Hi", and you see it on the Console when the program ends. When you hit Back, you go back to where you started. If you start in the Editor, you go back to the Editor. If you start in Android, you go back to Android.

To see it more clearly, put an END command in your program. When your program ends, you will see END printed on the Console. That way you know where you are. Note: use END, not EXIT!
Code:
Print "Hi"
END
Your second program is different.
Code:
Print "Hi"
Do
Until 0
Onbackkey:
Exit
When you run it your program prints "Hi", and then waits in an infinite loop. Your program has not ended. Then, when you hit the Back key, the OnBackKey: interrupt runs. It has an EXIT command. The EXIT command stops the BASIC! app immediately. The Console closes. It doesn't matter if you start in the Editor or the Launcher or a File Explorer, you return to Android.

So, because you use EXIT instead of END, and because you do not use the Editor, your two programs look like they do the same thing. In fact, they do not do the same thing at all.

Once you understand the things I wrote, you will find BASIC! behaves a lot like other BASIC dialects you have used. But it's an Android app. It is not the operating system of a Commodore 64. You have to understand that before you can do anything. Take a deep breath, slow down, and start at the beginning.

- Marc


Report this post
Top
 Profile  
 
 Post subject: Re: Hi (from Indonesia)
Unread postPosted: Mon Sep 22, 2014 11:46 am 
Offline

Joined: Wed Oct 03, 2012 9:53 am
Posts: 2802
Location: Colorado, U.S.
fitriantoh wrote:
Sorry, I think http://www.rfobasic.com (without a dash) and http://www.rfo-basic.com are same.

The first is Nick Antonaccio's tutorial. The second is (Nicolas) mougino's PC Suite for BASIC!. Both extremely useful, bien sûr, but not at all the same.

- Marc


Report this post
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2, 3  Next


Who is online

Users browsing this forum: No registered users and 0 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