Author Topic: Batch files and temp files, for scripting/interperter basic type programming.  (Read 217 times)

yf777aJoseph

  • Newbie
  • *
  • Posts: 15
  • Just simple man.
    • View Profile
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
_________________________________________
____________________________________________________
- Just Joe, have a good day.

yf777aJoseph

  • Newbie
  • *
  • Posts: 15
  • Just simple man.
    • View Profile
'probably within a week this type of scripting could be done by non experts
'with a little advice, so it could be tested on the fly.
food for thought... so if I'm being a nuisance it is perfectly gladly fine with me,
if I'm asked to let this be, truly, I'm just getting started, only hoping for some expert
help.
if this thread get flagged, you all know batch processing way better than me.
----
' a test suite would need a mathmatical regular expression routine(s)
' it could be line processing, thus little use of stacks, at first one stream of code,
' gosubs to come later...
print "this is a test."
print 4 + 17
print "dir" '*note shell("dir > dirlist.txt or dir, the pause in a writing batch file
            ' on the fly, the second avoids file time, for maybe time critical
            'or just a peek at the directory. the console has cut/past
            ' parameters to explorer.exe coud help someone in need
            ' knowing the directory/folder structure on their machine.
print "endOfLines"
- Just Joe, have a good day.

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 895
    • View Profile
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: May 06, 2021, 08:10:31 PM by MrBcx »

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 895
    • View Profile
Seems I uploaded the wrong files -- well, technically some of the right files but it doesn't
build the editor / interpreter as described.  Unfortunately, I don't think I have the correct 
project with me at this location ( summer home ).  I'll update when I get this sorted out
which may take a few days -- other priorities right now.
 

yf777aJoseph

  • Newbie
  • *
  • Posts: 15
  • Just simple man.
    • View Profile
Cool, so it certainly is not my original idea recently on the fly conceived
for the plausible versatile personal needs, so who knows, maybe after the more
the needed effort, it could get really 'fancy' without reinventing the wheel.
So, I will work at my slow needed pace, I hope hours per week.
An example, of elementary writing temp batch files, from a menu system,
it would be a huge effort to investigating mouse handling, but that would never
equal DosBox as far I can understand.  But, none the less, it really could be a decent
easy to use the shell, with only limited batch processing knowledge on the end user's end.
So the open-source, and available help could help those interested to know how
the GUIs work with similar event processing as keyboard and mouse pointers
on the old dos machines.
The versatility of BCX, certainly will make the hard effort gladly easier.
It really is one of the best, programming directly to the API I ever had come across.
The appreciation has been since the beginning, gradually learning from the BCXers
on even getting started with console GUI programming with BCX.
Have a good evening.
- Just Joe, have a good day.

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 895
    • View Profile
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.

yf777aJoseph

  • Newbie
  • *
  • Posts: 15
  • Just simple man.
    • View Profile
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 in much appreciation 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.
- Just Joe, have a good day.

yf777aJoseph

  • Newbie
  • *
  • Posts: 15
  • Just simple man.
    • View Profile
Wow, Microsoft seems to approve conceptually
and here is a proof positive a a concept at this url,
of even Visual Basic 3.0 16bit computing...
looks very complicated for someone like me, though.
someday, so many irons in the fire...
__________________
https://techcommunity.microsoft.com/t5/windows-dev-appconsult/running-16-bit-applications-on-windows-10-64-bit/ba-p/1671418

have a great day!
- Just Joe, have a good day.