Announcement

Collapse
No announcement yet.

Update 6.0.6.298232

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

  • Update 6.0.6.298232

    These are some of the new PHP features:

    The PHP implementation is pretty robust now. Most MYSQL_* statements have been dropped and replaced with Database.* Statements, but if you like using the MYSQL_* functions, you can now use the following macros:

    Code:
    MACRO MYSQL_FILL_UDT = DATABASE.load
    MACRO MYSQL_UPDATE_UDT = DATABASE.update
    MACRO MYSQL_NEXT_UDT = DATABASE.next
    MACRO MYSQL_DELETE_UDT = DATABASE.delete
    MACRO MYSQL_INSERT_UDT = DATABASE.insert
    MACRO MYSQL_CREATE_TABLE = DATABASE.createtable
    MACRO MYSQL_DELETE_TABLE = DATABASE.deletetable
    MACRO MYSQL_TABLE_EXISTS = DATABASE.tableexists
    MACRO MYSQL_RECORD_EXISTS = DATABASE.recordexists
    MACRO MYSQL_CONNECT = DATABASE.connect
    MACRO MYSQL_EXECUTE = DATABASE.execute
    MACRO MYSQL_ERROR = DATABASE.error
    MACRO MYSQL_CONNECTED = DATABASE.connected
    More of the functions will be ported soon.

    Also, if you work with HTML and JavaScript or jQuery, you will love the new statements:

    Code:
    UDT.serialize ' converts an UDT to an URI string.
    UDT.assign  ' reads an URI string unto an UDT (it will soon also support json strings).
    UDT.json ' Converts an UDT to a json string
    When querying a PHP script, you can, for example, return a JSON string from an UDT as follows:

    Code:
    STDOUT UDT.json(someUDTVar);
    When you receive the string in your Javascript code, you can then parse the UDT into an object like this:

    Code:
    var someUDTVar = JSON.parse(phpresult);
    This way you can communicate your PluriBASIC script with your Javascript code.


    www.patreon.com/pluribasic

  • #2
    Forgot to mention, these support MYSQL, MYSQLI and ODBC in PHP, it means that it generates specific code for the target server depending on the PHP version it reports and also the metacommands for database configurations.
    www.patreon.com/pluribasic

    Comment


    • #3
      Just uploaded version. 6.0.6.298278

      The only difference is that UDT.assign() can also handle a JSON string now. This means that it can now assign the values in a JSON string to an UDT variable, as follows:

      Code:
      [FONT=Courier New][B][COLOR=Blue]TYPE[/COLOR] [COLOR=Black]Example[/COLOR]
      [COLOR=Black]   a[/COLOR] [COLOR=Blue]AS[/COLOR] [COLOR=Blue]LONG[/COLOR]
      [COLOR=Black]   b[/COLOR] [COLOR=Blue]AS[/COLOR] [COLOR=Blue]STRING[/COLOR]
      [COLOR=Black]   c[/COLOR] [COLOR=Blue]AS[/COLOR] [COLOR=Blue]DOUBLE[/COLOR]
      [COLOR=Blue]END[/COLOR] [COLOR=Blue]TYPE[/COLOR]    
      
      [COLOR=Blue]FUNCTION[/COLOR] [COLOR=Black]PBMAIN[/COLOR][COLOR=Black]([/COLOR][COLOR=Black])[/COLOR] [COLOR=Blue]AS[/COLOR] [COLOR=Blue]LONG[/COLOR]
      
      [COLOR=Blue]    LOCAL[/COLOR] [COLOR=Black]Abc[/COLOR] [COLOR=Blue]AS[/COLOR] [COLOR=Black]Example[/COLOR]
      
      [COLOR=Black]    UDT.assign[/COLOR][COLOR=Black]([/COLOR][COLOR=Black]Abc[/COLOR][COLOR=Black],[/COLOR] [COLOR=DarkGreen]"{""a"": 12345, ""b"": ""Hello World"", ""c"": 2.345}"[/COLOR][COLOR=Black])[/COLOR]
      
      [COLOR=Blue]    STDOUT[/COLOR] [COLOR=Black]UDT.serialize[/COLOR][COLOR=Black]([/COLOR][COLOR=Black]Abc[/COLOR][COLOR=Black])[/COLOR]
      
      [COLOR=Blue]END[/COLOR] [COLOR=Blue]FUNCTION[/COLOR][/B][/FONT]

      The UDT.assign() line, stores the values from the JSON string, into the UDT variable. Then, the UDT.serialize() creates an URL parameters string using the values stored in the UDT variable. This should output:

      Code:
      a=12345&b=Hello+World&c=2.345

      Confirming that the values are correctly stored in the UDT variable.
      www.patreon.com/pluribasic

      Comment


      • #4
        The above features are now also available for 32bit executables (also CGI). 64bit versions are in progress.
        www.patreon.com/pluribasic

        Comment


        • #5
          The above features are now also available for 64bit executables (including CGI). Here is an example and the sample output it produces:

          Code:
          [FONT=Courier New][B][COLOR=Blue]#COMPILE[/COLOR] [COLOR=Black]EXE[/COLOR]
          [COLOR=Blue]#COMPILER[/COLOR] [COLOR=Black]OXYGEN[/COLOR]
          [COLOR=Blue]#OPTIONS[/COLOR] [COLOR=Black]X64[/COLOR] [COLOR=Black]DEVELOPER[/COLOR]
          [COLOR=Blue]#DIM[/COLOR] [COLOR=Blue]ALL[/COLOR]
          [COLOR=Blue]#DATABASE[/COLOR] [COLOR=Blue]OPEN[/COLOR]
          
          [COLOR=Blue]TYPE[/COLOR] [COLOR=Black]Example2[/COLOR]
          [COLOR=Black]   e[/COLOR] [COLOR=Blue]AS[/COLOR] [COLOR=Blue]STRING[/COLOR]
          [COLOR=Black]   f[/COLOR] [COLOR=Blue]AS[/COLOR] [COLOR=Blue]LONG[/COLOR]
          [COLOR=Blue]END[/COLOR] [COLOR=Blue]TYPE[/COLOR]
          
          [COLOR=Blue]TYPE[/COLOR] [COLOR=Black]Example[/COLOR]
          [COLOR=Black]   a[/COLOR][COLOR=Black]([/COLOR][COLOR=Black]1[/COLOR][COLOR=Black])[/COLOR] [COLOR=Blue]AS[/COLOR] [COLOR=Blue]LONG[/COLOR]
          [COLOR=Black]   b[/COLOR] [COLOR=Blue]AS[/COLOR] [COLOR=Blue]STRING[/COLOR]
          [COLOR=Black]   c[/COLOR] [COLOR=Blue]AS[/COLOR] [COLOR=Blue]DOUBLE[/COLOR]
          [COLOR=Black]   d[/COLOR][COLOR=Black]([/COLOR][COLOR=Black]1[/COLOR][COLOR=Black])[/COLOR] [COLOR=Blue]AS[/COLOR] [COLOR=Black]Example2[/COLOR]
          [COLOR=Blue]END[/COLOR] [COLOR=Blue]TYPE[/COLOR]
          
          [COLOR=Blue]FUNCTION[/COLOR] [COLOR=Black]PBMAIN[/COLOR][COLOR=Black]([/COLOR][COLOR=Black])[/COLOR] [COLOR=Blue]AS[/COLOR] [COLOR=Blue]LONG[/COLOR]
          
          [COLOR=Blue]   LOCAL[/COLOR] [COLOR=Black]Abc[/COLOR] [COLOR=Blue]AS[/COLOR] [COLOR=Black]Example[/COLOR]
          
          [COLOR=Black]   UDT.assign[/COLOR][COLOR=Black]([/COLOR][COLOR=Black]Abc[/COLOR][COLOR=Black],[/COLOR] [COLOR=DarkGreen]"a[0]=12345&b=Hello World&c=2.11345&d[1][e]=Its like magic!"[/COLOR][COLOR=Black])[/COLOR]
          [COLOR=Blue]   STDOUT[/COLOR] [COLOR=Black]UDT.serialize[/COLOR][COLOR=Black]([/COLOR][COLOR=Black]Abc[/COLOR][COLOR=Black])[/COLOR]
          
          [COLOR=Black]   UDT.assign[/COLOR][COLOR=Black]([/COLOR][COLOR=Black]Abc[/COLOR][COLOR=Black],[/COLOR] [COLOR=DarkGreen]"{""a"": 12345, ""b"": ""Hello World"", ""c"": 2.11345}"[/COLOR][COLOR=Black])[/COLOR]    
          [COLOR=Blue]   STDOUT[/COLOR] [COLOR=Black]UDT.serialize[/COLOR][COLOR=Black]([/COLOR][COLOR=Black]Abc[/COLOR][COLOR=Black])[/COLOR]    
          
          [COLOR=Black]   Abc.a[/COLOR][COLOR=Black]([/COLOR][COLOR=Black]1[/COLOR][COLOR=Black])[/COLOR] [COLOR=Black]=[/COLOR] [COLOR=Black]2938983[/COLOR]
          [COLOR=Black]   Abc.b[/COLOR] [COLOR=Black]=[/COLOR] [COLOR=DarkGreen]"Hello world"[/COLOR]
          [COLOR=Black]   Abc.c[/COLOR] [COLOR=Black]=[/COLOR] [COLOR=Black]4.333[/COLOR]
          [COLOR=Black]   Abc.d[/COLOR][COLOR=Black]([/COLOR][COLOR=Black]1[/COLOR][COLOR=Black])[/COLOR][COLOR=Black].e[/COLOR] [COLOR=Black]=[/COLOR] [COLOR=DarkGreen]"It works"[/COLOR]
          
          [COLOR=Blue]   STDOUT[/COLOR] [COLOR=Black]UDT.serialize[/COLOR][COLOR=Black]([/COLOR][COLOR=Black]Abc[/COLOR][COLOR=Black])[/COLOR]
          [COLOR=Blue]   STDOUT[/COLOR] [COLOR=Black]UDT.json[/COLOR][COLOR=Black]([/COLOR][COLOR=Black]Abc[/COLOR][COLOR=Black])[/COLOR]
          
          [COLOR=Blue]   STDOUT[/COLOR] [COLOR=DarkGreen]"done"[/COLOR]
          
          [COLOR=Blue]END[/COLOR] [COLOR=Blue]FUNCTION[/COLOR][/B][/FONT]
          Output:

          Code:
          a[0]=12345&a[1]=0&b=Hello+World&c=2.1134499999999998&d[0][e]=&d[0][f]=0&d[1][e]=Its+like+magic%21&d[1][f]=0
          a[0]=12345&a[1]=0&b=Hello+World&c=2.1134499999999998&d[0][e]=&d[0][f]=0&d[1][e]=&d[1][f]=0
          a[0]=12345&a[1]=2938983&b=Hello+world&c=4.3330000000000002&d[0][e]=&d[0][f]=0&d[1][e]=It+works&d[1][f]=0
          {"a": [12345, 2938983], "b": "Hello world", "c": 4.3330000000000002, "d": [{"e": "", "f": 0}, {"e": "It works", "f": 0}]}
          done
          These output results are compatible with PHP and JavaScript. This makes working with backend scripts very simple.
          www.patreon.com/pluribasic

          Comment

          Working...
          X