It is currently Thu Apr 27, 2017 5:37 pm



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  [ 86 posts ]  Go to page 1, 2, 3, 4, 5 ... 9  Next
Author Message
 Post subject: Hot summer of code
Unread postPosted: Wed Jun 29, 2016 12:36 pm 
Offline
User avatar

Joined: Wed Jul 10, 2013 8:11 am
Posts: 299
Google has the Summer of Code.
But we have a Hot Summer of Code.
Marc made important changes in the background.
Nicolas design an on site compiler and added some zip commands.

So I contribute my own extensions and updates based on version 1.90.
It's alpha so command description, arguments and names could be changed.
I hope you enjoy.
The files are zipped and stored under:
https://github.com/RFO-BASIC/Basic/issues/211

Code:
N_E_W_S

  APP.INSTALLED check, "com.google.zxing.client.android",vN$, vC
  APP.LOAD "file://" + dataPath$ + "/" + "Bookworm_de.apk"
  APP.LOAD "market://details?id="+ "com.google.zxing.client.android"
  IF barcodeFirstRun = 0
   BUNDLE.PUT globals,"barcodeFirstRun",1
   APP.INSTALLED check, "com.google.zxing.client.android"
   IF check = 0
    APP.LOAD "market://details?id="+ "com.google.zxing.client.android"
    DIALOG.MESSAGE "Installing succeeded?", "Please confirm", buttonResult, "Yes", "No"
    IF buttonResult = 2
     BUNDLE.PUT globals,"barcodeFirstRun",0
    ENDIF
   ENDIF
   ...
  ELSE
   ...
  ENDIF
 
  APP.SAR appVarPointer %App.SartAndReceive with a Java like Interface %The references are cut!
  ! E.g. FileBrowser, BarCodeScanner, GoogleMaps, ... are now supported
  Note: The Blackmoon FileBrowser is suggested, because it needs no clipboard for multiple files.

  N_E_W        Bundle supports all variable types
  ARRAY.LOAD c$[], "D","E","F","G","H","I"
  BUNDLE.PUT globals,"myStringArray_C", c$[]
  DIM myStringArray_C$[11]
  BUNDLE.GET globals,"myStringArray_C", myStringArray_C$[]

  ARRAY.LOAD m[], 4,-5,6,-7,8,-9
  BUNDLE.PUT globals,"myDoubleArray_M", m[]
  ARRAY.LOAD myDouble_M[],1,2,3,4,5,6,7
  BUNDLE.GET globals,"myDoubleArray_M", myDouble_M[] %You get m[] = {4,-5,6,-7,8,-9}

  BUNDLE.PB myFirstBundle, "globals", globals %BUNDLE.PUT.BUNDLE %The references are cut!
  BUNDLE.GB myFirstBundle, "globals", globals %BUNDLE.GET.BUNDLE %The references are cut!
  BUNDLE.PL myFirstBundle, "globals_list_ptr", list_ptr %BUNDLE.PUT.LIST
  BUNDLE.GL myFirstBundle, "globals_list_ptr", list_ptr2 %BUNDLE.GET.LIST
  BUNDLE.PS myFirstBundle, "stack_ptr", stack_ptr %BUNDLE.PUT.STACK
  BUNDLE.GS myFirstBundle, "stack_ptr", stack_ptr2 %BUNDLE.GET.STACK
  BUNDLE.COPY sourceBundle, b2 %The references are cut!
  BUNDLE.TYPE --> N, N[2,.,..], S, S[2,.,..], Bundle, List, Stack

  O_L_D
  EMAIL.SEND myTO$, myS$, myB$
  N_E_W
  EMAIL.SEND myTO$(or[]), myS$, myB${{{{, sendTo$}, myCC$(or[])}, myBCc$(or[])}, FileList$(or[])}
   

For details see examples and the manual extensions!

Happy coding
Gregor

EDIT:
Changed two GET to PUT


Last edited by aFox on Wed Sep 21, 2016 5:20 am, edited 2 times in total.

Report this post
Top
 Profile  
 
 Post subject: Re: Hot summer of code
Unread postPosted: Wed Jun 29, 2016 1:00 pm 
Offline
User avatar

Joined: Thu Jan 08, 2015 11:28 am
Posts: 1088
Location: .NET
aFox wrote:
Google has the Summer of Code.
But we have a Hot Summer of Code.
Marc made important changes in the background.
Nicolas design an on site compiler and added some zip commands.

So I contribute my own extensions and updates based on version 1.90.
It's alpha so command description, arguments and names could be changed.
I hope you enjoy.
The files are zipped and stored under:
https://github.com/RFO-BASIC/Basic/issues/211

Happy coding
Gregor


i dont understand why would you need these extra commands for bundles (stacks, bundles and lists), pointers are enough. bundle.copy and adding arrays to bundles could be useful though.

app.sar looks interesting too

i think you can list all installed packages using System's 'pm list packages'
also i think you can install packages with 'pm install'

_________________
https://github.com/evolbug
http://toobasic.jimdo.com


Report this post
Top
 Profile  
 
 Post subject: Re: Hot summer of code
Unread postPosted: Wed Jun 29, 2016 2:02 pm 
Offline
User avatar

Joined: Wed Jul 10, 2013 8:11 am
Posts: 299
evolbug wrote:
i dont understand why would you need these extra commands for bundles (stacks, bundles and lists), pointers are enough.


To transfer data to and from external apps and bundles it is very handy.
Second you are able to return a complete set of variables of all supported types from a function with only one pointer.

evolbug wrote:
i think you can list all installed packages using System's 'pm list packages'
also i think you can install packages with 'pm install'

Yes, you can and starting apps per system command, too.
But that is not beginners business ;)

/Gregor


Report this post
Top
 Profile  
 
 Post subject: Re: Hot summer of code
Unread postPosted: Thu Jun 30, 2016 7:44 am 
Offline
User avatar

Joined: Thu Nov 21, 2013 7:00 pm
Posts: 631
That's quite impressive aFox!
And I understand the need for a bundle to carry an array.

But i have to extend evolbug's question about lists and stacks,
A list ptr is just a number is it not? Bundles can already carry numbers right?

Is there something I'm missing ?
e.g BUNDLE.PL
Is all of the source list's contents being copied (row by row) to a single field inside the target bundle ?
Is this field a special type for another app to recieive or recognise? Is that the purpose?

_________________
- Failure is not an option. It is bundled with the software. -


Report this post
Top
 Profile  
 
 Post subject: Re: Hot summer of code
Unread postPosted: Thu Jun 30, 2016 10:14 am 
Offline
User avatar

Joined: Wed Jul 10, 2013 8:11 am
Posts: 299
humpty wrote:
A list ptr is just a number is it not?

Yes
humpty wrote:
Bundles can already carry numbers right?

No
humpty wrote:
Is there something I'm missing ?
e.g BUNDLE.PL

Yes, BUNDLE.PL is implemented.
humpty wrote:
Is all of the source list's contents being copied (row by row) to a single field inside the target bundle ?

BUNDLE.PL -> In this implementation the List is only referenced. But if you use Bundle.Copy or Bundle.PB the transferred Bundle is a complete new Bundle. So the references to the old List are cut.
For references see also the manual at FN.DEF.
humpty wrote:
Is this field a special type for another app to recieive or recognise? Is that the purpose?

Mainly the purposes are:
The opinion to have global arrays, too.
EDIT: The possibility to call an array variable in a function by value.
Handy data transfer to extended Apps, Intents ....
An alternative to the Type command in other BASIC dialects
Code:
   TYPE name
      field1 AS type
      field2 AS type
      .
      .
      fieldN AS type
   END TYPE

The cleanest way to handle those Bundles is a List from type Bundle.
May be the next goal. Java support this type.
So take us a look in the future like LIST.Create B lb_pointer.

/Gregor


Report this post
Top
 Profile  
 
 Post subject: Re: Hot summer of code
Unread postPosted: Wed Sep 21, 2016 5:15 am 
Offline
User avatar

Joined: Wed Jul 10, 2013 8:11 am
Posts: 299
Hi all,

A new test version OliBasicIV is available under https://github.com/RFO-BASIC/Basic/files/484850/OliBasicIV.zip.
Now it is based on BASIC! 1.90.01

Changes:
Code:
The old one:
GrabURL <result_svar>, <url_sexp>{, <timeout_nexp>}
The new one:
GrabURL <result_svar>, <url_sexp>{{, <timeout_nexp>},<unicode_flag_lexp>}

See also
http://rfobasic.freeforums.org/how-to-download-a-map-t4536-10.html

I should not forget to say:"First deinstall your current BASIC! app!", because Easyapk is on strike with my apk.

New capabilities:
Code:
BUNDLE.PP varPointer, bitmapPointerA %Read BUNDLE.PUT.PICTURE
BUNDLE.GP varPointer, bitmapPointerB %Read BUNDLE.GET.PICTURE

BUNDLE.SAVE varPointer, "myBundle.bun"
BUNDLE.LOAD newVarPointer, "myBundle.bun"


The last two are only recommended for temporary use, because the internal coding is os version depended.
Bitmaps in bundles are also not supported in this case.
Maybe there is a size limitation. Not tested yet.

Happy coding
Gregor


Report this post
Top
 Profile  
 
 Post subject: Re: Hot summer of code
Unread postPosted: Sun Sep 25, 2016 7:02 am 
Offline
User avatar

Joined: Mon Aug 18, 2014 1:16 pm
Posts: 1317
Hi aFox

So you can do Java. How about implementing global variables so that they can be seen in functions. ;)

Roy


Report this post
Top
 Profile  
 
 Post subject: Re: Hot summer of code
Unread postPosted: Sun Sep 25, 2016 8:08 am 
Offline
User avatar

Joined: Thu Jan 08, 2015 11:28 am
Posts: 1088
Location: .NET
how about explicitly definable global variables?

GLOBAL var

because having everything global is a terrible idea

_________________
https://github.com/evolbug
http://toobasic.jimdo.com


Report this post
Top
 Profile  
 
 Post subject: Re: Hot summer of code
Unread postPosted: Sun Sep 25, 2016 8:27 am 
Offline
User avatar

Joined: Mon Aug 18, 2014 1:16 pm
Posts: 1317
evolbug wrote:
how about explicitly definable global variables?

GLOBAL var

because having everything global is a terrible idea


Is there anywhere in my post that says ' having everything global' no.

What I meant was to set the variables you want to global.
For example:

Global score, highScore
Global names$
Global dim addresses$[10]

And if you just use gosub's then everything is global, so I guess that's 'terrible'


Report this post
Top
 Profile  
 
 Post subject: Re: Hot summer of code
Unread postPosted: Sun Sep 25, 2016 12:13 pm 
Offline

Joined: Tue Mar 03, 2015 12:33 pm
Posts: 75
Option explicit! :o


Report this post
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 86 posts ]  Go to page 1, 2, 3, 4, 5 ... 9  Next


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:  
cron
suspicion-preferred