Recent Posts

Pages: [1] 2 3 ... 10
1
Scripting Languages / Re: ScriptBasic 3.0
« Last post by John on May 07, 2024, 09:29:21 AM »
Most of the Windows 32 code was developed on Windows 7 so I don't see any issues running the current version of SB on it.

The OPEN statement also supports a serial port connection. I have only done a quick test long ago using AT commands to to a controller.

VB6 + VBCCR allows me to create modern UI solutions as a COM DLL. I don't use VB6 for anything else. I don't see Microsoft dropping VB6 runtime support anytime soon.

Quote
I may even take that approach and create DLLs when I get to that point.

If you go that direction let me know and I'll send you what is needed to create a form DLL.
2
Scripting Languages / Re: ScriptBasic 3.0
« Last post by AlyssonR on May 07, 2024, 05:13:38 AM »
Terminal interface:
All I need is an interpretation/formatting layer between serial port and terminal window
  - to take custom escape codes and put/grab data as required
  - thus reducing the static data overhead on the remote device application (with only
    a few kB of application storage)

Windows Compatibility:
I don't actually use many 'features' of Windows in my software as it is mostly file and
text-like data manipulation along with whatever maths I need to do. So long as file
handling and comms is backward compatible, the programs should run trouble free.

Small systems:
Most of my hardware projects are too small to be able to host an OS and GPIO is
handled directly on the metal. Any control from input has to be handled at that level
(i.e. assembler, C/C++ or B4R)

Historical BASIC:
I do have QB64, but I prefer SB and VBS. VBA is still a part of my version of Office.
VB6 will, it seems, never get old unless you use windows features that have been
removed. It remains (on W7) a good option for GUI and Q&D development.

I don't even use a DBMS, just a couple of random-access index files, INI tally files
and a directory tree. (mineral collection records). Storage is, after all, cheap.

For front-end - VS (VB/VC) serves well enough right now if I want a proper GUI and
SB's support on W7 breaks - right now It seems to work fine, though.

I should point out, here, that I am not interested in commercial polish since functionality
trumps all.

Socket connections:
As a friend used to say - poifick - at least where an RS232 (RS422/485) interface
don't reach directly.

3
NOT BASIC / Multithreaded Mandelbrot using 8th
« Last post by jalih on May 06, 2024, 09:44:55 PM »
Here is a multithreaded Mandelbrot program using 8 rendering threads + main GUI thread. Uses complex math for calculations.

Code: [Select]
needs nk/gui

libbin font/Roboto-Regular.ttf

font/Roboto-Regular.ttf font:new "font1" font:atlas! drop

600 constant WIDTH
600 constant HEIGHT

8 constant NUMTASKS

WIDTH HEIGHT img:new constant buffer

WIDTH 1.5 n:/ 40 n:+ constant x-axis
HEIGHT 2 n:/ constant y-axis
300 constant scale
50 constant iterations

: c:^  \ c n -- c
  >r dup c:abs r@ n:^ swap c:arg
  dup 2 a:close
  0 ( r@ n:* n:cos ) a:op!
  1 ( r> n:* n:sin ) a:op!
  swap >r ( r@ n:* ) a:map c:new rdrop ;
 
nullvar mand-task-ids

: mand-task  \ start-row end-row --
  ( drop
    (  drop
       0 0 c:new "z" t:!

       I x-axis n:- scale n:/
       J y-axis n:- scale n:/
       c:new dup "c" t:!

       c:>ri "y" t:! "x" t:!
       "y" t:@ 2 n:^ "y2" t:!
       "x" t:@ 0.25 n:- 2 n:^ "y2" t:@ n:+
       dup "x" t:@ 0.25 n:- n:+ n:* "y2" t:@ 4 n:/ n:<
       "x" t:@ n:1+ 2 n:^ "y2" t:@ n:+ 0.0625 n:< or !if
         ( "z" t:@ 2 c:^ "c" t:@ c:+ dup "z" t:!
           c:abs 2 n:> if
             765 n:* iterations n:/ dup>r 510 n:< !if
               255 255 r> 255 n:mod n:int 255 4 a:close "color" t:!
               break
             else
               r@ 255 n:< !if
                 255 r> 255 n:mod n:int 0 255 4 a:close "color" t:!
                 break
               else
                 r> 255 n:mod n:int 0 0 255 4 a:close "color" t:!
                 break
               then
             then
           else
             drop
             0 0 0 255 4 a:close "color" t:!
           then
         ) 0 iterations n:1- loop
         buffer lock J I "color" t:@ img:pix! unlock lock HEIGHT J n:- I "color" t:@ img:pix! unlock drop
       then
    ) 0 WIDTH n:1- loop
  null nk:do
  ) -rot loop ;

: start-tasks
  HEIGHT 2 n:/ NUMTASKS n:/mod 0 >r
  a:new ( r@ third n:r+ r@ n:1- 2 ' mand-task t:task-n a:push ) NUMTASKS n:1- times
  -rot n:+ r> tuck n:+ 2 ' mand-task t:task-n a:push mand-task-ids ! ;

: new-win
  {
    name: "main",
    wide: @WIDTH,
    high: @HEIGHT,
    resizable: true,
    title: "Mandelbrot"
  }
  nk:win ;

: main-render
  {
    title: "mandel",
    bg: "black",
    padding: [0,0],
    flags: [ @nk:WINDOW_NO_SCROLLBAR ]
  }

  nk:begin
    null 1 1 nk:layout-grid-begin
      0 1 0 1 nk:grid nk:rect>local nk:grid-push buffer lock nk:image buffer unlock drop
    nk:layout-grid-end
  nk:end ;

: app:main
  ' start-tasks w:is nk:rendering
  new-win ' main-render -1 nk:render-loop ;
4
Scripting Languages / Re: ScriptBasic 3.0
« Last post by John on May 06, 2024, 01:34:29 PM »
ScriptBasic has been compiled on current supported OS versions. SB isn't a substitute for QuickBasic or other ancient BASIC interpreters. I will not be supporting any Windows version earlier than Windows 10.

The Windows 32 bit version was released as a binary distribution and a compilation of my efforts over the years. I have no plans of extending this version. All development efforts going forward will be based on Windows 64 bit and Linux.

5
Scripting Languages / Re: ScriptBasic 3.0
« Last post by John on May 06, 2024, 12:00:22 PM »
The CIO extension module is used to control the console display with positioning and colors.

SB also supports a socket connection with OPEN statement.

You should checkout the RaspberryBASIC forum I host. I have examples of using the GPIO extension I created.
6
Scripting Languages / Re: ScriptBasic 3.0
« Last post by AlyssonR on May 06, 2024, 11:53:04 AM »
Quote
What would be really good would be a utility to take VB forms (without code) and to turn them
into viable SB forms - sadly, I know that I don't have the patience (or skill) to write it. An ANSI
terminal forms handler, OTOH, may be within my wheelhouse - sometimes a text interface is
just what the doctor ordered.

I use VB6 with VBCCR to create form / class COM DLLs as my user GUI interface on Windows 32 bit. The form events callback to SB FUNCTION / SUB routines which I use to load grids and update my DB. HERE is an example I posted in this thread. My plan was to start a new thread showing how to use VB6 + VBCCR to create a modern looking GUI that runs on Windows 10 and 11. I've held back starting this thread to see how the ScriptBasic 3.0 release and its use progressed. So far you are the only person that has taken the time to respond.

I may even take that approach and create DLLs when I get to that point.

As a fairly keen retrocomputing and MCS-51 person, ANSI terminals are very much an in technology for me and a lightweight handler for serial to display port is a definite path to reducing the (cursor addressing / graphics boxes / colour encoding) overhead on the remote board is the difference between glass teletype and VT100+ behaviours - and brings the possibility of multipage forms on board, not to mention background data logging.

The fact that a PC if considerable power is used as a terminal for a 64k text-only device is quite apart from the point - I get fed up with the disparate, pretty GUIs on remote devices that just swallow bandwidth on the network.

For reference, I use:

Windows 7
Windows Server 2008 (R2)
DOS 6.22
MCS-51 (bare metal)
Arduino ecosystem (bare metal)
7
Scripting Languages / Re: ScriptBasic 3.0
« Last post by John on May 06, 2024, 08:06:37 AM »
Quote
I was always planning on using SB in a couple of projects and I have used it in the
past for some quick and dirty admin processes across my network.

If there was a glueware class of software SB would be at the top of the list. I save a lot of money for my clients connecting processes together to automate the solution.

Quote
Variant variables and undeclared types are good - even though I prefer to declare variables.

SB by default declares variables as global to the module. This includes FUNCTION/SUB variables not passed as arguments which are local by default. You can change this with SB option settings to require that all variables be assigned or SB will not run run the script. You also set the option that all variables in FUNCTION /SUB are local by default. Normally the only time I initialize a variable is if I'm incrementing it with += or &=. SB doesn't like incrementing undef variables. I rarely use STR() or VAL() functions with SB variant variables.

PRINT "1" + "2"  would return 3
PRINT 1 & 2 would return "12" 


Quote
Arrays. I'm still used to keeping track of them by numeric indices.

I rarely use indexed based arrays. All the DB extenion modules support returning the data in associative arrays. I wrote a JSON to SB associative function (webext.sbi) that makes working with JSON a dream. HERE is an example of using the webext.sbi extension module with a JSON string.


Quote
What would be really good would be a utility to take VB forms (without code) and to turn them
into viable SB forms - sadly, I know that I don't have the patience (or skill) to write it. An ANSI
terminal forms handler, OTOH, may be within my wheelhouse - sometimes a text interface is
just what the doctor ordered.

I use VB6 with VBCCR to create form / class COM DLLs as my user GUI interface on Windows 32 bit. The form events callback to SB FUNCTION / SUB routines which I use to load grids and update my DB. HERE is an example I posted in this thread. My plan was to start a new thread showing how to use VB6 + VBCCR to create a modern looking GUI that runs on Windows 10 and 11. I've held back starting this thread to see how the ScriptBasic 3.0 release and its use progressed. So far you are the only person that has taken the time to respond.



8
Scripting Languages / Re: ScriptBasic 3.0
« Last post by AlyssonR on May 06, 2024, 01:24:05 AM »
I was always planning on using SB in a couple of projects and I have used it in the
past for some quick and dirty admin processes across my network.

One code branch is brilliant (but not needed for me ... yet)
Variant variables and undeclared types are good - even though I prefer to declare variables
Module name space means not really changing mental gears from VB6
Optional case sensitive string functions sells it for me

C extension will be useful when I get around to it
Arrays. I'm still used to keeping track of them by numeric indices

What would be really good would be a utility to take VB forms (without code) and to turn them
into viable SB forms - sadly, I know that I don't have the patience (or skill) to write it. An ANSI
terminal forms handler, OTOH, may be within my wheelhouse - sometimes a text interface is
just what the doctor ordered.



That small footprint is useful, even though I generally have stacks of memory available,
but combined with thread-based meory model, means that multi-process and multi instance
isn't going to break the bank

9
Scripting Languages / Re: ScriptBasic 3.0
« Last post by John on May 03, 2024, 03:55:26 PM »
This is a list of ScriptBasic features I really like.
  • No need to dimension or declare variables or their type. This includes arrays.
  • One code branch for all platforms.
  • Thread centric memory model.
  • High level C extension module API. (CBASIC enhanced)
  • Case sensitivity option with string functions.
  • Module based name space design.
  • Variant based variables.
  • Arrays (or any range of it) can be appended to any element of another array with a = assignment. Arrays can be indexed, associative or a combination of both.
  • Less than 800KB footprint.

My most favorite / used is the SPLIT and LIKE functions.
10
Scripting Languages / Re: ScriptBasic 3.0
« Last post by John on April 30, 2024, 07:18:22 PM »
I have moved the ScriptBasic forum to sb.allbasic.info as a static HTML copy for reference. My plan is to redo the site using the ScriptBasic Application Web Server. (sbhttpd) using Nginx as the front end.
Pages: [1] 2 3 ... 10