Basic4GL v2.6.0 released

You heard right! There’s been a new Basic4GL release for the first time in nearly 6 years.

Grab it from the Basic4GL website.

What’s new

This release is mainly about refreshing the IDE, and updating third party libraries to modern, open source versions, so that Basic4GL itself can be open sourced under the BSD license. There’s a new Qt editor, the OpenGL window management uses GLFW, and the whole thing can be built using Visual Studio Community edition.

You can download the source from here for now.

B4glDesktop

The demo programs are now installed to the all-users documents folder, to comply with Windows User Access Control (UAC) rules (so WriteFileDemo.gb actually works on Vista and later).

I’ve also put a bit of effort into cleaning up the help files and bringing them up to date.

And there are a couple of new commands as well. Check the Programmers’ Guide for UpdateWindow() and OpenAppDataRead()/-Write().

Breaking changes

There are some breaking changes in this version to be aware of.

Support for Windows XP and earlier operating systems has been dropped (mainly because this version is built with Visual Studio 2013, and also possibly due to 3rd party library minimum requirements).

OpenGL software mode is not supported in this release (although it may be added back later – depending on if/when GLFW implements a software mode window creation hint).

Finally, debugging applications in full-screen mode doesn’t work all that well. There seems to be issues switching back and forth between the desktop and full screen window (you often need to hit Alt-Tab a couple of times to help it out). I’m hoping to sort this out in a future release. Until then it’s much less hassle to use a windowed mode while debugging.

 

Anyway, let me know if there are any issues. Otherwise enjoy.

 

This entry was posted in Uncategorized. Bookmark the permalink.

5 Responses to Basic4GL v2.6.0 released

  1. Ed Davis says:

    Hello!

    For let me say that Basic4GL is very impressive! Good job!

    I have a little benchmark program that I use to test integer operations and looping speed of various interpreters and compilers. I’ve successfully tested it with the follow Basic interpreters/compilers:

    FreeBasic
    BCX
    VisualBasic.Net
    Oxygen Basic
    PowerBasic
    QB64
    JWillia basic
    ChipMunkBasic
    Yabasic
    SdlBasic
    SmallBASIC
    SpecBAS
    BBCBasic
    ThinBasic
    FBSL
    Scriba
    RCBasic
    LBB
    DDS5
    MY-BASIC
    MiniBASIC
    nuBASIC
    Basic256
    bscript

    However, for some reason, I have not been able to get it to run correctly in Basic4GL. Would you be able to spot what I’m doing wrong?

    The program should print out the following sequence:

    200574 60372774 120544974 180717174 240889374 301061574 309886830

    But when I run the Basic4GL version, I get:

    195452

    And nothing else.

    Here is the program – this is very similar to the one I’ve run for the processors listed above:

    —————————————–
    dim left_edge as integer
    dim right_edge as integer
    dim top_edge as integer
    dim bottom_edge as integer
    dim max_iter as integer
    dim x_step as integer
    dim y_step as integer
    dim y0 as integer
    dim x0 as integer
    dim x as integer
    dim y as integer
    dim i as integer
    dim x_x as integer
    dim y_y as integer
    dim temp as integer
    dim the_char as integer
    dim accum as integer
    dim count as integer

    accum = 0
    count = 0
    while count bottom_edge
    x0 = left_edge
    while x0 < right_edge
    y = 0
    x = 0
    the_char = 32
    x_x = 0
    y_y = 0
    i = 0
    while (i < max_iter) and (x_x + y_y 800 then
    the_char = 48 + i
    if i > 9 then
    the_char = 64
    end if
    else
    temp = x_x – y_y + x0
    if ((x 0)) or ((x > 0) and (y < 0)) then
    y = (-1 * ((-1 * x * y) / 100)) + y0
    else
    y = (x * y / 100) + y0
    end if
    x = temp
    end if

    i = i + 1
    wend
    accum = accum + the_char

    x0 = x0 + x_step
    wend

    y0 = y0 – y_step
    wend

    if count % 300 = 0 then
    print accum
    end if

    count = count + 1
    wend

    print accum
    —————————————–

    Note. I've tried setting the main loop counter to 1 (instead of 1545) and for other processors, the result is 200574. For Basic4GL however, it is still 195452.

    Thanks for any help!

    • Ed Davis says:

      Arg! The formatting of the code appears to have been lost. I promise I don’t write code without indenting! I can email you a version of the program if that would help. If you would like me to, just email me, and I’ll send it.

      Thanks again!

      • Matthew says:

        Hi Ed, I currently haven’t got access to Basic4GL at the moment but the incorrect result may be because of how Basic4GL handles integer division. In traditional BASIC when dividing integers the answer is promoted to a float, whereas Basic4GL just discards the remainder.

    • admin says:

      I’ve given it a try.

      It does actually keep going after printing 195452, it just takes a little while.
      Basic4GL is a virtual machine based language, so it can’t compete speed-wise with those that compile to actual machine code. But it does get there.

      If you set the language to “traditional” (in the Basic4GL options), division is performed using floating point. In which case it outputs:
      200612
      60384212
      120567812
      180751412
      240935012
      301118612
      309945540

      I couldn’t say why the numbers are different.
      My recommendation would be to debug through the code in Basic4GL and another BASIC and try to narrow down the point where it starts to diverge.

      Incidentally, I tried it in QBasic (using the DOSBOX emulator) and it eventually output 200730

  2. Ed Davis says:

    I found the problem.

    In the languages I’m familiar with, multiplication and division have the same precedence. When both occur in the same expression, without parenthesis, order is from left to right.

    In Basic4GL, it appears that either division has higher precedence over multiplication, or order is from right to left.

    For instance:

    printr 7 * 285 / 100 + 285
    printr (7 * 285 / 100) + 285
    printr (7 * 285) / 100 + 285
    printr ((7 * 285) / 100) + 285

    The first two expressions print 299.
    The second two print 304.

    I would argue that this is inconsistent with what is standard arithmetic.

    But in any case, I still think Basic4GL is pretty cool!

    So I changed the code, and used parenthesis to force the precedence/ordering needed, and now I get the expected sequence with Basic4GL.

    (200574 60372774 120544974 180717174 240889374 301061574 309886830)

Comments are closed.