Switch to full style
Would you like to see changes or additions to BASIC! This is place to make those requests.
Post a reply

Re: Hot summer of code

Mon Mar 20, 2017 1:18 pm

Hi Gregor

I tested the APK and it runs well.

Regards Roy
fileSnap.PNG
fileSnap.PNG (25.85 KiB) Viewed 595 times

Re: Hot summer of code

Fri Mar 24, 2017 5:09 am

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

Re: Hot summer of code

Fri Mar 24, 2017 9:04 am

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

So do I; thanks for that!

Mike.

Re: Hot summer of code

Mon Mar 27, 2017 12:30 pm

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

Re: Hot summer of code

Tue Mar 28, 2017 11:14 am

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

Re: Hot summer of code

Tue Mar 28, 2017 12:24 pm

Excellent work Gregor

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
Post a reply