rfobasic.freeforums.org
http://rfobasic.freeforums.org/

Hot summer of code
http://rfobasic.freeforums.org/hot-summer-of-code-t4408-80.html
Page 9 of 9

Author:  roy [ Mon Mar 20, 2017 1:18 pm ]
Post subject:  Re: Hot summer of code

Hi Gregor

I tested the APK and it runs well.

Regards Roy
Attachment:
fileSnap.PNG
fileSnap.PNG [ 25.85 KiB | Viewed 558 times ]

Author:  aFox [ Fri Mar 24, 2017 5:09 am ]
Post subject:  Re: Hot summer of code

Hi All,

Some asked me why I use the underscore so often like

"_Source", "_SourceSamples", "_Data"~
, "_Database", "_App", "_AppPath", "_Alarms", "_Dcim", "_Documents"~
, "_Downloads", "_Movies", "_Music", etc.

The Reason is, with the undersore you now at the first look: "This have to do with the BASIC! system :!: "
Behind this are predeffined functions, constants, expressions etc..

Maybe it is also a good suggestion to use the underscore at the end or a better one at the beginning for your predefined elements.

I like this link, too:
https://blog.codinghorror.com/new-programming-jargon/

Happy coding
Gregor

Author:  mjcoon [ Fri Mar 24, 2017 9:04 am ]
Post subject:  Re: Hot summer of code

aFox wrote:

So do I; thanks for that!

Mike.

Author:  aFox [ Mon Mar 27, 2017 12:30 pm ]
Post subject:  Re: Hot summer of code

BUG BUG BUG

If you use the command DEBUG.DUMP.BUNDLE my version will crash :!:

I hope, I am able to publish the fix soon.
I have to upgrade three Bundle commands, too.
Now I am testing

/ Gregor

Author:  aFox [ Tue Mar 28, 2017 11:14 am ]
Post subject:  Re: Hot summer of code

Hi All

I fixed the issue above.

13. FILE.EXISTS accepts string expressions and values. See description.
Now are no changes in older programs and libs needed.
14. BUNDLE.GET and DEBUG.DUMP.BUNDLE convert Java Objects to strings.
If possible!
15. BUNDLE.TYPE modified

The new version link:
https://github.com/RFO-BASIC/Basic/files/876323/OliBasicXVII.zip

Here is an example how to reseive system network broadcast messages
(In this case ACCESS_NETWORK_STATE permission is nedded)
and Bundle enhancements:

Code:
REM Start of BASIC! Program NetworkBroadcasts.bas


FN.DEF bprint(bundle, msg$)
PRINT msg$

BUNDLE.KEYS bundle, list
LIST.SIZE list, size
IF size = 0
  PRINT "Empty bundle"
  PRINT " "
  FN.RTN 0
ENDIF

FOR i = 1 TO size
  LIST.GET list, i, key$
  !  Print key$

  BUNDLE.TYPE bundle, key$, type$
    Print "type$ "; type$

  IF type$ = "N"
   BUNDLE.GET bundle, key$, value
   PRINT key$, value
  ELSE
   BUNDLE.GET bundle, key$, value$
   PRINT key$, value$
  ENDIF

NEXT i

PRINT " "
FN.RTN 1
FN.END
DEBUG.ON
Counter = 0

ARRAY.LOAD actions$[],"android.net.wifi.STATE_CHANGE",~
"android.net.wifi.WIFI_STATE_CHANGED",~
"android.net.conn.CONNECTIVITY_CHANGE",~
"android.net.conn.INET_CONDITION_ACTION"
BROADCAST.INIT actions$[]
DIALOG.MESSAGE "Stop and Restart your WiFi Connection", "GoOn?", selection, "OK"

DO
UNTIL 0

BROADCAST.CLOSE
END

ONBROADCAST:
PRINT "Received Broadcast! .: "
BROADCAST.IN retAction$, retData$, retBundleIndex
PRINT "retAction$ ",retAction$
PRINT "retData$ ",retData$
Counter ++
x = bprint(retBundleIndex, INT$(Counter))
DEBUG.DUMP.BUNDLE retBundleIndex
BROADCAST.RESUME


Example APK:

https://github.com/RFO-BASIC/Basic/files/876467/NetworkBroadcasts.zip

Happy coding
Gregor

Author:  roy [ Tue Mar 28, 2017 12:24 pm ]
Post subject:  Re: Hot summer of code

Excellent work Gregor

Quote:
13. FILE.EXISTS accepts string expressions and values. See description.
Now are no changes in older programs and libs needed.

Alway good to be backward compatible ;)

Demo works well.

Regards Roy

Page 9 of 9 All times are UTC - 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/