Author Topic: Batch files for BASIC scripting/interpreter programming.  (Read 332 times)

yf777aJoseph

  • Newbie
  • *
  • Posts: 12
  • Just simple man.
    • View Profile
Batch files for BASIC scripting/interpreter programming.
« on: May 05, 2021, 04:04:09 PM »
Hello.
Truly wonderful programming community for programmers at various levels of expertise.
In appreciation, a not ready nearly for prime time proposal... the experts would know better,
just how feasible this is. Six months for an alpha stage offering had there been enough,
shared hours? Maybe.
this is jumping ahead, but I've noticed BCX is so versatile, expert programmers could
 do way more than my more modest abilities.
So, I've written out batch processing, on the fly interacting with the operating system,
which certainly could help with easy to use scripting, and if security is a problem,
encryptions techniques could be used.
With a regular expression for mathematics implementation, the built-in functions/subs
hooks into at least win32 could be very advantageous.
Other than the above, the data structures are not that difficult,
and the program applications for scripting or interpreting basic BCX style has so much
research and development hours built right in the huge immense amount of hours
which you all have invested over the years.
SuperBatch.exe would be a cool tool, with so much to think about, it could be just
regular BCX code practically, with #batch section directives, and such.
So, I'm not that far along, but I will be working on it in my spare time, I'm recuperating
right now. so here is just a little example of how relatively easy it could be.
Any project leaders interested?
Have a wonderful evening... I've done some of this already, yes it's on my PC very primative,
so maybe a thread will develop. Peace.
__________________________not real code but the ideas are quite clear_______________________
sub input_line(linesOfCoding[], curLine, totalLines)
trap keyboard editig keys later on,
one line at a time, reediting.. at first for ease of development.
or use notepad, easy peasy.
later develop, a block editor routine, save chunks of 512, with eol(s)
could be a subroutine with parameters of totalLines, linePtr, linesOfCoding[]
end sub





sub storeLine(curLine as int)
  linesOfCode[curline]
  ...
  store in temp file. close file
  store backup file as lines are entered, close file
end sub

type basicMathLineRecord
int lineNum
string lineOfCode$
parsed ints
parsed order of operations
end type basicMathLineRecord
_________________________________________
____________________________________________________
« Last Edit: July 25, 2021, 10:05:01 PM by MrBcx »
- Just Joe, have a good day.

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 959
    • View Profile
Re: Batch files for BASIC scripting/interpreter programming.
« Reply #1 on: May 05, 2021, 06:03:46 PM »
Joe,

Attached is a console mode text file editor that I originally wrote in TurboBASIC a hundred years ago.  50 years ago I converted it to BCX, and in 2018, I added Andreas Guenther's BCX subset BASIC interpreter to it.

The attached zip contains all the source code, build.bat ( targeting Pelles C ) and a bunch of samples to illustrate what works.  I believe Wayne Halsdorf helped Andreas along the way and possibly others.  The interpreter derives from the sample BASIC interpreter found in Herb Schildt's  Turbo "C" book from the 1980's.

I integrated the standalone interpreter with my editor, fixed a boatload of issues so it can be compiled with the latest version of BCX and Pelles C, and generally made things more user friendly.  The whole thing is still buggy but it mostly works and is full of stuff to learn from. 

Attachment deleted -- was flawed.  A replacement is forthcoming in a day or two. 
« Last Edit: July 25, 2021, 10:09:42 PM by MrBcx »

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 959
    • View Profile
Re: Batch files for BASIC scripting/interpreter programming.
« Reply #2 on: May 06, 2021, 09:20:40 PM »
Attached is the project that I originally intended to upload.  Several things changed since 2018 that required updates to the project and to BCX.  I could only get this project to run using a 32-bit executable produced by Pelles C v10.   It also requires BCX 7.6.7 ( uploaded today ).

This project will compile with other compilers and even run a little bit but only Pelles C produced an app
that is stable enough to run the samples without crashing.   I did not test all the samples but I did test
about a dozen or more and they ran as expected.

When compiling, you will get 4 ( or more ) warnings from Pelles but they should be mostly harmless.

If anyone makes significant improvements, please share them with the group.
« Last Edit: July 25, 2021, 10:10:16 PM by MrBcx »

yf777aJoseph

  • Newbie
  • *
  • Posts: 12
  • Just simple man.
    • View Profile
Re: Batch files for BASIC scripting/interpreter programming.
« Reply #3 on: May 10, 2021, 09:29:06 AM »
Thank you.
I'm going to have a dual install, BCX up to date, and the 5.11a with the ver. 1.29
of the old BCX_DevSuite that works well for my personal usages, so when I get time,
I will download ed.zip.
_____
also,
________
Guess what?  There is a worthwhile short cut for what I have planned,
just have to find out a Freedos type opensource license, so that,
with BCXscript installation, other opensource **seperate* installations,
such as, DosBox0.74, with the open source Freedos like C:\Dos directory,
after everything is installed.

Then the BCX console app(s) can have menus, to launch 16bit programs
by replacing the autoexec part of the .config file before DosBox0.74
launch.

There could be a file(s) system, whereby, paths or other info between
32bit console and/or 16bit dos and/or 32bit GUI applications could
communicate.

It would be a work in progress, but since DosBox0.74, with licensed
opensource Freedos type of files, in the same directory structure,
it would be the best of the 32bit computing, without reinventing
the wheel of already in place 16bit computing techniques.
« Last Edit: July 25, 2021, 10:10:36 PM by MrBcx »
- Just Joe, have a good day.