hBasic changelog Date Summary of Versions (related hcodes in brackets) --------------- ------------------------------------------------------------ 2020-07-19 v3.00 (0300, K0001) Scoped Storage Base directory moved to Scoped Storage. Removed legacy storage access minSdkVersion bumped up to API 19 (KitKat) Package name changed from com.rfo.basich to com.rfo.hbasic Fix for Sensors (K0001) 2020-06-02 v2.94 (0294) Fix bug of manifest permission.BLUETOOTH_ADMIN 2020-04-02 v2.93 (0293) Fix to suppress crash for DEVICE command for Android-10+ 2020-03-02 v2.92 (0292) Targets API 29 with legacy storage mode. 2019-11-01 v2.91 (0290, 0291) Shortcut support for standalone APK. (only works if compiled with hSuite) (0290) Added Device.OS (0291) a) changed Program output Title back to 'hBasic' b) changed default Titles for Console, SELECT, TEXT.INPUT, and TGET to generic. c) changed splash screen d) APK signed with a different key. (you need to un-install any old version). 2019-07-09 v2.81 (0281) Changed Brackets '[..]' to Braces '{..}' for Bundle.put/get 'auto' mode. 2019-07-07 v2.80 (0271,0272,0273,0280) Added 'auto' mode for bundle.get/put (0280) Added FILE.SAF.MKDIR (0271) Added 'a'ppend mode for FILE.SAF.OPEN (0273) Upgraded support library for FILE.SAF commands (master 1.51) Minor change to TEXT/BYTE.open (0272) 2019-06-09 v2.70 (0270) Added FILE.SAF commands 2019-05-21 v2.61 (0261) Replaced GR.CLIP with GR.CLIP.START/END (solution for API 28). (0261). 2019-05-15 v2.60 (0260) Support to android target api level 28. (min:14, target:28, compile:28) SMS commands removed. Changes to 'About' screen as per 01.92. Internal note: all changes this round merged to hbasic-master-v1.4 2019-01-15 v2.50 (0250) Added SQL.PING + Removed H0210 - Bundle Expressions (interfering with webview/basic interface) + (v2.40 no release) Added Array Functions Accept solo FN.RTN Change error msg of gr.modify if syntax error instead of "Object Out of Range" Fixed "&=" pre-assign op bug. (Internal note: hPatch 0240 merged into hbasic-master-v1.3) 2018-12-04 v2.30 (0230) Added REDIM + (v2.20 no release) Accept Array pointers for assignment (Internal note: hPatch 0220 merged into hbasic-master-v1.2) 2018-10-17 v2.11 (0211) Enhanced bundle expressions; Accept quoted key as string constant bundle."quoted key" Accept embedded bundle.keys 2018-10-07 v2.10 (0210) Added recognition of a 'bundle expression' to parser. Changed the App Icon. (Internal note: hPatch 0120 merged into hbasic-master-v1.1) 2018-09-10 v2.00 Support to android target api level 26. (min:14, target:26, compile:26) Changed package_name to com.rfo.basich Changed version number to 02.00 Changes to 'About' and Editor start screens. Internal note: all changes this round merged to hbasic-master-v1.0 2018-04-08 v1.61 (0161) Remove fos.flush() from byte.write.buffer 2018-03-21 v1.60 (0160) Faster byte.write.buffer (ack:aFox) 2018-03-13 v1.50 (0150) a) gr.hide/show Multiple objects b) bundle.get/put Multiple key,value pairs c) Program output Title changed back to 'BASIC!' 2018-03-10 v1.40 (0140) gr.bitmap.clr clears a bitmap with transparency gr.bitmap.blot clears a rectangle in a bitmap with transparency 2018-02-18 v1.30 (0130) Fix for ROUND function for precise input values 2018-02-14 v1.21 (0121) Fix scope for new variables created in main interrupt block. 2018-01-14 v1.20 (0110,0120) a) Fix for volkeys - to reset to ON (no block) at start of Run. (ack:aFox) b) Fix for scope during interrupt. c) Program output Title changed to hBASIC! to distinguish 2017-10-29 v1.00 (0100) Added FN.IMPORT ============================================================================ hBasic hMaster v2.00 v1.0 First master with code to target api-26. v2.10 v1.1 H0120 merged to master (avoids conflict with H0210) v2.11 v1.1 v2.20 v1.2 H0220 merged to master (avoids conflict with H0210) v2.30 v1.2 v2.50 v1.3 H0240 merged to master (avoids conflict with H0100) v2.60 v1.4 First master with code to target api-28. v2.61 v1.41 H0261 merged to master. Replaced gr.clip to work with api-28. v2.70 v1.5 Added infrastructure for SAF. Fixed colors for adding shortcut. v2.72 v1.51 More infrastructure for SAF, cwac-document upgraded to 0.4.1 H0150,H0272,H0273 merged to master. v2.80 v1.51 v2.81 v1.51 v2.91 v1.52 Title changes: Program Output,Console,SELECT,TEXT.INPUT,TGET. Changed splash screen Changed APK signature. v2.92 v1.6 Targets API 29 with legacy storage mode. v2.93 v1.6 fixed DEVICE crash v2.94 v1.61 fixed bluetooth permission bug v3.00 v2.0 Base moved to Scoped Storage. minSdkVersion API 19 (KitKat) Merged patches to master: H0100, H0110, H0130, H0160, H0230, H0291, H0293 package name changed to com.rfo.hbasic (instead of com.rfo.basich) ============================================================================ Patch hCodes X = suspended (do not use) M = Merged to hmaster and patch deleted (do not use after) D = defunct H0100 M 0100 FN.IMPORT H0110 M 0110 VolKeys fix H0120 M 0120 + 0121 Interrupt Scope fixes H0130 M 0130 ROUND math function fix H0140 0140 gr.bitmap.clr/blot H0150 M 0150 Multi input for gr.hide/show bundle.put/get H0160 M 0160 + 0161 faster byte.write.buffer H0210 X 0210 + 0211 bundle.key expressions - ON HOLD - (interfering with webview/basic interface) H0220 M 0220 Array pointers and assignment H0230 M 0230 REDIM H0240 M 0240 Array Functions M 0241 FN_RTN mod M 0242 gr.modify error_msg mod M 0243 Fix "&=" pre-assign op H0250 0250 SQL.PING H-SMS X +SMS put back SMS commands (for future use only) H0261 M 0261 replace GR.CLIP with GR.CLIP.START and GR.CLIP.END H0270 0270 + 0271 + 0273 FILE.SAF commands H0272 M 0272 change TEXT/BYTE.OPEN to not add file table entry if failed to open. H0280 0280 + 0281 BUNDLE.PUT/GET 'auto' mode H0290 0290 Enable standalone APK to pick up data from a shortcut launcher. H0291 M 0291 Device.OS -none D 0292 Targets API 29 with legacy storage mode. H0293 M 0293 Fix crash for DEVICE on Android-10+ -none M 0294 fix bug with bluetooth permission in manifest -none M 0300 move base to scoped storage instead of sdcard/ K0001 0300 Fix Sensors with less then 3 Return Values. ack:dkal,afox ============================================================================ hCode Details 0100 FN.IMPORT Imports 'global' variables into functions. Inserts referenced main variables into the local symbol table. Only the 'main' symbol table is searched. 0110 Volkeys state Fix (ack:aFox) Run.java When volkeys.off is run in the editor, the next program that is run does not reset mBlockVolKeys (to false), so volume keys stay blocked. Editor.java startActivity(new Intent(this, Run.class)); seems not to create a new instance but re-use the old instance presumably still on the task stack (with old data still intact). Fix was to reset mBlockVolKeys inside InitVars() of Run class. 0120 Interrupt Scope Fix Functions called by interrupt block were getting wrong scope. Fix was to have variable lookup check for a scope flag(new). Scope flag gets updated by other parts of the system. Variable lookup will use only the main scope for the main program block and main interrupt block. All functions, wherever called, will use the local scope. 0121 Interrupt Scope Fix for new variables Make sure new variables in main interrupt block are always created in main scope. 0130 ROUND math function fix ROUND uses BigDecimal for rounding BUT the input values were still binary64 leading to precision errors. Fix was to use BigDecimal(String) instead of BigDecimal(double). 0140 gr.bitmap.clr {,paint} Fills a bitmap with transparency without destroying it. Anything already on the bitmap is cleared. There is no alpha blending. Optional color from a paint. approx. 10x faster than delete+create. gr.bitmap.blot , x, y, width, height {,paint} Same as gr.bitmap.clr but fills a rectangle within bitmap. Slower than delete+create but faster for small areas less than a half. 0150 gr.hide {, }... gr.show {, }... New syntax allows multiple objects separated by commas. e.g gr.hide cat,dog,mouse bundle.put , , | {, }... bundle.get , , | {, }... New syntax allows multiple key,value pairs separated by commas. e.g bundle.put mybundle, "Key1",99, "Key2","RED", "Key3","Balloons" (note: A comma is still needed if using continuation char '~'). 0160 Faster byte.write.buffer Uses a byte array and writes once instead of per char. (ack:aFox /note:no charset conversion provided) 0161 Code tidy-up Removed fos.flush() from byte.write.buffer, as it does nothing. 0210 bundle.key expressions recognised. * ON HOLD * - (interfering with webview/basic interface) Added recognition of bundle.key expressions to the parser. e.g bundle.create mybundle % mandatory mybundle.key1 = 99 mybundle.key2 = "red" print mybundle.key2 % red n = ++mybundle.key1 print n % 100 note: keys can auto-create on assignment but bundle(ptrs) cannot. 0211 bundle.key expressions enhanced. * ON HOLD * - (interfering with webview/basic interface) Accept quoted key as string constant e.g bundle.create mybundle mybundle."key 1" = "red" mybundle."key$ 2$" = 99 % still valid. (no type checking) Embedded bundle keys are allowed (bundles within bundles) e.g mybundle.key1.key2.key3 key1 is evaluated as the index of key2 key2 is evaluated as the index of key3 The last key will be evaluated as the final value. Only the last key can be auto-created. 0220 Accept Array pointers e.g a[], a$[] for assignment and evaluation. Assignments e.g a[] = b[] a[] = b[] % makes an exact copy of b[] to a[] including the size and dimensions. If a[] already exists, original background references of a[](i.e passed by reference) are preserved. Evaluation (for future mod). Evaluation of a[] always returns 0 ( might be changed in the future ) Evaluation of a$[] always returns "" ( might be changed in the future ) Evaluation of non-existent a[] also returns 0 or "" ( might be changed in the future ) The term 'array pointer' is a reference to an array. You may think of it as representing the whole array. This is inline with traditional Basic 01.91 which already uses the syntax for some commands and functions. The behaviour for array pointers (e.g a[]) has only been changed for evaluation and assignment. It has not been changed when given to Basic commands or functions e.g myfunc (a[]). This is because Basic commands and functions do their own parsing and have thier own rules for arrays without indices. 0230 REDIM Added REDIM {preserve_nexp}, Array[{, } ... ] ... Re-Dimensions an existing array with optional 'preserve contents' flag. Referenced arrays are not cut off (when passing to a user function). Arrays must already exist before REDIM. If the preserve flag is zero, the array will be full of 0's or "". If the preserve flag is non-zero, the old contents will be preserved to the size of the old or new array, whichever was smallest. Any cells left-over will be 0's or "". Preserve flags may be inserted anywhere in the arguments list. Arrays following a preserve flag will honor that preserve flag until the next preserve flag. e.g REDIM 1,[a], 0,b[] 1,c[],d[] % b[] will not be preserved Preserve flags cannot be array expressions e.g p[3], as this would re-dim p[3]. 0240 Array Functions Functions can now return an Array (pointer) e.g fn.def func_a$(n)[] % define an Array Function dim b$[3] b$[2] = "nice" if n=1 then fn.rtn % returns a useless default array if n=99 then fn.rtn b$[] % return specified array fn.end % returns default array ! fn.def func_a$() % Function previously defined at: a$[] = func_a$(99)[] % Array function assignment (deep copy) ! print func_a$(99)[] % Error> Array functions cannot be evaluated : print a$[2] % only normal arrays can be evaluated 0241 Accept solo FN.RTN Functions can now have FN.RTN without an argument returning a default value. The default return value is the same as FN.END, for a number this is 0.0 for a string this is "" for an array this is a one dimensional array with one element (containing 0.0 or "") 0242 gr.modify error message modified Instead of returning "Object Out of Range", will report "Syntax Error" if the object pointer cannot evaluate to a number. (Object numbers that are out of range are unaffected.) Consolidated similar error msgs of other commands to do the same. 0243 Pre-Assign "&=" bug fixed. "&=" was dropping into "|=" op immediatley after, giving wrong result. inserted missing 'break;' 0250 SQL.PING , {, {,}} (A) SQL.PING r, db % ping only the database (B) SQL.PING r, db, "mytable" % ping a table, (C) SQL.PING r, db, "mytable", "col1" % ping a table and column Returns the size (number of rows) of a database or table to r. In case (A), this is the total number of user tables in the db. The return code is as follows; -1 = table name does not exist -2 = table name exists but column does not exist in the table >=0 = The total number of tables in the database or rows in the table. In case (C), this also means both table and column exists. 0260 Upgrade to target API 28 All SMS commands permissions and code removed. (moved to patch 0261 for future use). 0261 Replace GR.CLIP with GR.CLIP.START and GR.CLIP.END API 28 only allows for Intersect and Difference region Operators. The other operators will crash basic if used before this fix. GR.CLIP.START replaces GR.CLIP and only accepts Intersect and Difference GR.CLIP.END must be used later after objects have been clipped. GR.CLIP.END restores the canvas to before the last GR.CLIP.START thus resetting the size for future clips. Do not interwine GR.CLIP.xxx commands with GR.ROTATE. i.e always END one command type matching the last START. 0270 FILE.SAF commands FILE.SAF.GRANT Uri$ grants r/w permission for SAF storage FILE.SAF.REVOKE {baseUri$} release permssion,persistance FILE.SAF.CHECK rc {,baseUri$} check permssion,persistance FILE.SAF.SET rc, Uri$ set the saf base directory FILE.SAF.GET Uri$ {,name$} get the saf base directory FILE.SAF.DIR path$, Array$ {,dirmark$} get a directoy list FILE.SAF.RENAME rc,oldPath$, newName$ rename a file FILE.SAF.DELETE rc, path$ delete a file FILE.SAF.EXISTS rc, path$ see if file exists FILE.SAF.OPEN mode {t,b,r,w}, fileNum, path$ open a file for basic 0271 Added FILE.SAF.MKDIR rc,path$ create dir 0272 Changed TEXT/BYTE.OPEN not to add file table entry if failed to open. 0273 Added 'a'ppend mode for FILE.SAF.OPEN FILE.SAF.OPEN mode {t,b,r,w,a}, fileNum, path$ open a file for basic 0280 Added 'auto' mode for bundle.get/put 'auto' mode will get or put variables with the same name tag. Tags must/will be lower case with no spaces. String tags must/will have ending '$' 0281 Changed Braces from '[..]' to '{..}' for 'auto' mode for bundle.get/put e.g bundle.put mybundle, {v1, v2$, v3} % creates and puts vars v1,v2$,v3 % into tags "v1", "v2$", "v3" bundle.get mybundle, {v1, v2$, v3} % loads v1,v$2,v3 with tags "v1","v2$","v3" 0290 Enable standalone APK to pick up data from a shortcut launcher. (this only works for hSuite. Other APK makers probably ignores any shortcut data). (does not interfere with standard-Basic apk shortcuts.) 0291 Added DEVICE.OS get the android version string without needing READ_PHONE_STATE permission. 0292 Targets API-29 with legacy storage flag in Manifest. (defunct since v3.00) 0293 Fix don't crash for DEVICE on Android-10+ 0294 Fix bug of manifest permission.BLUETOOTH_ADMIN typo. 0300 Changed to Scoped Storage. Removed legacy storage flag e.g base /Android/data/com.rfo.hbasic/ appdir /Android/data/com.rfo.hbasic/rfo-basic Access allowed to any directory on or after the base. Access denied to any directory before the base. minSdkVersion bumped up to API 19 (KitKat) Editor: Restrict loading directory to scoped storage. Scoped storage requires that copying of files to e.g [base]/source needs an app that has permissions to do so e.g, a capable file manager. K0001 Fix Sensors with less then 3 Return Values; Was crashing with Android-10 devices crash when using SENSORS commands. ack: dkal, daveacre, aFox Fix taken from aFox's 'RFO github 265' via dkal's K0001 patch (modified for com.rfo.hbasic) (will be merged to master in next version). -End-