Announcement

Collapse
No announcement yet.

PluriBASIC Update 6.0.6.302989

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PluriBASIC Update 6.0.6.302989

    There have been many updates and upgrades.
    • Associative arrays are now working for PowerBASIC 32 bit, Oxygen 32 and 64 bits, Python, PHP, Java (Android and Jar) . Javascript still in progress.
    • Associative arrays work with RESET (full array or individual item).
    • Associative items can be passed as parameters BYVAL and BYREF.
    • Associative items can be used with DDT syntaxes and other available native statements.
    • Stacked function calls are more stable now for all target platforms.
    • Stacked function calls now also work with Strings, Hex values, Oct values, Binary values, variables, user functions and System functions.
    • Added support for functions returning UDT's for PHP and Python.
    • Added support for 3rd party FTP clients to the IDE.
    • Fixed a SSH bug when transfering Python scripts to a Raspberry PI.
    • Fixed a bug macro functions that would prevent conversion.
    • Fixed a bug macro functions that make it fail when several macro functions were invoked in the same line.
    • Fixed a bug with VAL for PHP, Oxygen and Java, as well as added support for oct, bin and hex.
    • Fixed #REPORT for PHP (Error)
    • Fixed INPUT # for PHP's string variables (other data types are still in the work).
    • Fixed a few miscompatibilities of older PHP (5.4) code for newer versions (PHP 7.4)
    • Fixed a bug in FORMAT$ for PHP conversions.
    • Fixed other various bugs.
    Examples of supported syntaxes:

    Code:
    [COLOR=#9b59b6][B]STDOUT[/B][/COLOR] [COLOR=#8e44ad][B]DATE$.UCASE$[/B][/COLOR]
    Code:
    [COLOR=#9b59b6][B]STDOUT DATE$.TRIM$([/B][B]ANY[/B][/COLOR][COLOR=#16a085][B]"0"[/B][/COLOR][COLOR=#9b59b6][B])[/B][/COLOR]
    Code:
    [COLOR=#9b59b6][B]STDOUT DATE$.JULIAN[/B][/COLOR]
    Code:
    [COLOR=#9b59b6][B]STDOUT &HFDE0.GREGORIAN[/B][/COLOR]
    Code:
    [COLOR=#9b59b6][B]STDOUT TRIM$(DATE$.userformatting)[/B][/COLOR]

    Code:
    #DIM ALL
    #COMPILE PHP with PLURIBASIC
    '#COMPILE PYTHON with PLURIBASIC
    '#COMPILE EXE with PBWIN
    '#COMPILE EXE with OXYGEN
    '#COMPILE jar with java
    #OPTIONS X32 developer
    #PROJECT "yourproject"
    
    
    TYPE exampletable
        id CONDITION NOTNULL AUTOINC primary AS LONG
        username AS STRING
        password AS STRING
        sname AS STRING
        age AS LONG
        comment AS STRING
    end type
    
    FUNCTION json(byref u as UDT) AS STRING
        FUNCTION = UDT.json(u)
    end function
    
    FUNCTION PBMAIN() AS LONG
    
        local tbl as exampletable
    
        ' The following syntaxes are all valid.
        STDOUT json(tbl)
        STDOUT tbl.json
        STDOUT udt.json(tbl)
    
    END FUNCTION

    Development continues steadily.


















    www.pluribasic.com
    www.patreon.com/pluribasic

  • #2
    I made a couple enhancements:

    Since it is pointless to use LBOUND and UBOUND in Associative arrays, the engine will now throw a compilation error when attempted.

    Also, Associative array enumeration was added, here's an example:

    Code:
    DIM Ar() AS ASSOCIATIVE
    LOCAL Key AS STRING
    
    Ar("oranges") = "Hello World"
    Ar("apples") = "It's amazing"
    
    FOR EACH Key IN Ar()
         STDOUT Key & " = " & Ar(Key)
    NEXT
    Outputs:

    Code:
    oranges = Hello World
    apples = It's amazing
    Added:
    Forgot to mention that in order to be consistent across platforms, i made the keys case-sensitive.
    www.pluribasic.com
    www.patreon.com/pluribasic

    Comment


    • #3

      THREAD CREATE is now working again after the complete re-do of the statement handler.

      Associative arrays can now use squared brackets when assigning or reading their values, for example:

      Code:
      Ar["oranges"] = "Hello World"
      Ar["apples"] = "It's amazing"
      Round brackets are still required when refering to its root. For example:

      Code:
      [COLOR=#8e44ad][B]FOR EACH[/B][/COLOR] Key [COLOR=#8e44ad][B]IN[/B][/COLOR] Ar()
      www.pluribasic.com
      www.patreon.com/pluribasic

      Comment

      Working...
      X