It is currently Tue May 23, 2017 1:53 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  [ 19 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Include - inject portion of code
Unread postPosted: Wed Mar 22, 2017 4:28 am 
Offline

Joined: Mon Oct 10, 2016 6:27 am
Posts: 36
Hello.

Sorry, it could be some bad understanding about the docs...

I have a program, now with a huge code number of lines.
I´m thinking the best way to organize this code.
I´ve tried to separate "blocks" of code, putting in the main program a include call to a subprogram.
It is not working.

In "rfo wuick apk" i included the subprogram bas files.

Is possible to do wht i´m trying?
Or is there a better way to organize a big code on rfo?


(this is the best programming language. Other may seam good looking and more potencial...)


Report this post
Top
 Profile  
 
 Post subject: Re: Include - inject portion of code
Unread postPosted: Wed Mar 22, 2017 8:30 am 
Offline

Joined: Tue Dec 04, 2012 10:50 am
Posts: 656
Location: UK
Do you mean as in the Basic! command:
Quote:
Include FilePath
Before the program is run, the BASIC! pre-processor replaces any Include
statements with the text from the named file. You can use this to insert another BASIC! program file
into your program at this point.


If you do not, how is your question different?

Mike.


Report this post
Top
 Profile  
 
 Post subject: Re: Include - inject portion of code
Unread postPosted: Wed Mar 22, 2017 8:41 am 
Offline

Joined: Mon Oct 10, 2016 6:27 am
Posts: 36
Hello. Thanks for reply...

bas file a1.bas:
print "base"
pause 5000
include a2.bas

bas file a2.bas:
print "secund"
pause 5000

this produces an error on include file "error on opening INCLUDE file a2.bas"
Both files have a selection in source path, in quick apk window.


Report this post
Top
 Profile  
 
 Post subject: Re: Include - inject portion of code
Unread postPosted: Wed Mar 22, 2017 10:01 am 
Offline
User avatar

Joined: Mon Aug 18, 2014 1:16 pm
Posts: 1336
Hi coimbras
I give a demo of how to use an include file, bellow
post35149.html?hilit=inclued#p35149

Regards Roy


Report this post
Top
 Profile  
 
 Post subject: Re: Include - inject portion of code
Unread postPosted: Wed Mar 22, 2017 10:12 am 
Offline

Joined: Mon Oct 10, 2016 6:27 am
Posts: 36
Thanks, just change to quotes "" as some examples says.
Still on error.
Maybe is just about the path, or some option to include files, that i can´t see.
I edited the xml created by quickapk and there is no reference to include other file...

:(


Report this post
Top
 Profile  
 
 Post subject: Re: Include - inject portion of code
Unread postPosted: Wed Mar 22, 2017 11:53 pm 
Offline
User avatar

Joined: Mon Aug 18, 2014 1:16 pm
Posts: 1336
Hi coimbras
Save this Include File as 'myIncludeFile.bas' in RFO Basic's source folder

Code:
Rem my Include File
Rem Save this Include File as 'myIncludeFile.bas' in RFO Basic's source folder

?"Hello World from my Include file"
pause 2000
?"Goodbye from my Include file"

pause 2000


Save this main File as 'mainFile.bas' in RFO Basic's source folder

Code:
Rem Main
Rem Save this main File as 'mainFile.bas' in RFO Basic's source folder
Rem Run this file from RFO Basic

include "myIncludeFile.bas"
?"-=-=-=-=-=-=-=-=-=-=-=-=-"
?"Now in the main program"

pause 2000

end "Goodbye from main"



Run 'mainFile.bas' from RFO Basic

Should see output below

Regards Roy
Attachment:
includeSnap.PNG
includeSnap.PNG [ 33.75 KiB | Viewed 423 times ]


Report this post
Top
 Profile  
 
 Post subject: Re: Include - inject portion of code
Unread postPosted: Thu Mar 23, 2017 3:24 am 
Offline

Joined: Mon Oct 10, 2016 6:27 am
Posts: 36
Hello.
Thanks for your time...

In my phone in BASIC! program editor works fine.

When buil the apk on PC on Quick APK, something i´m doing wrong.

In Quick APK is there the only needed selection i´m doing??

Image


Report this post
Top
 Profile  
 
 Post subject: Re: Include - inject portion of code
Unread postPosted: Thu Mar 23, 2017 4:07 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5518
Location: Paris, France
Hi coimbras,

your include file needs to be in "rfo-basic/source" in your Quick APK home directory.

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Report this post
Top
 Profile  
 
 Post subject: Re: Include - inject portion of code
Unread postPosted: Thu Mar 23, 2017 4:08 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5518
Location: Paris, France
Tip: click the "read me" link at the top of the Quick APK window.

_________________
- Creator of the Android BASIC! Compiler


Report this post
Top
 Profile  
 
 Post subject: Re: Include - inject portion of code
Unread postPosted: Thu Mar 23, 2017 5:36 am 
Offline

Joined: Mon Oct 10, 2016 6:27 am
Posts: 36
Sorry... No way it works on Quick APK.
Could be a version bug or something???

I put her firsts lines of xml:

<?xml version="1.0" encoding="utf-8"?>

<set_local_folder path="C:\APKs\" />

<use_base_apk source="C:\Program Files (x86)\RFO-BASIC! Quick APK\tools\Basic.apk" target="mainFile.apk">

<!-- Copy program source (main .bas + include files) and resources -->
<delete_folder source="assets" />
<copy_file source="rfo-basic/source/mainFile.bas" target="assets/mainFile/source/mainFile.bas" />

<!-- Change app splash screen -->
<delete_file source="res/drawable/splash.png" />
<copy_file source="C:\Users\0e00049\AppData\Local\Temp\dummy" target="res/drawable/splash." />


Report this post
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  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