ok if i ask a DOSbox-X batch, need to read 2nd string

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
nnnmmm
Posts: 184
Joined: 26 Aug 2017 06:11

ok if i ask a DOSbox-X batch, need to read 2nd string

#1 Post by nnnmmm » 14 Feb 2025 01:20

is it ok if i ask a DOSbox-X batch command here?
the commands in there are very limited

SET Spec=ST2.
FOR %%V IN ('TYPE %Spec%') DO SET X=%%V
ECHO %X%
PAUSE
this doesnt work with DOSBox-x

a file ST2. has 2 lines, it goes like this
old ABC

i need a batch that returns a var ABC
2nd line is an empty line
are there batch commands to get the 2nd string ABC?

"old" is the basic compiler's command to load a file ABC
once i exit the basic compiler, i need to send the file "ABC" to a different directory to compile and make an ABC.EXE there
i hope to do it in one batch file

i can not just add a string "ABC" to a batch, it must be read, because i have 10s of "ST2."s from many directories and they are constantly changing, it depends on what file i am working, ST2. is auto-produced by the basic compiler's macro.

jeb
Expert
Posts: 1058
Joined: 30 Aug 2007 08:05
Location: Germany, Bochum

Re: ok if i ask a DOSbox-X batch, need to read 2nd string

#2 Post by jeb » 14 Feb 2025 06:22

Hi nnnmmm,
nnnmmm wrote:
14 Feb 2025 01:20
i need a batch that returns a var ABC
2nd line is an empty line
are there batch commands to get the 2nd string ABC?
I suppose not, but you could solve it with a trick.

Build one config file which contains only the "ABC".
Then you can build the spec file before you start the compiler by

Code: Select all

echo old > ST2
type config.cfg >> ST2

nnnmmm
Posts: 184
Joined: 26 Aug 2017 06:11

Re: ok if i ask a DOSbox-X batch, need to read 2nd string

#3 Post by nnnmmm » 14 Feb 2025 09:21

echo old > ST2
type config.cfg >> ST2
config file which contains only the "ABC"

i dont see how the above can work... and
it got more complicated. it was not just "ABC" and it was ABC.TRU and i need to change to ABC.TRC before i can send, i need a string manipulation later for this if there is one in dosboxx. i may have to look for someone who can write assembler to send errorlevels or something to read bytes from the 5th position to 5 + 8.3 = 16th position of a file.

there is more personal story below you can skip it at this point
*****************************************************************************
a file ST2. has 1 line in dosboxx and xtree in DOS, it looks like below
old ABC.Tru

the basic command code looks like below and it becomes the the DUMBEST binary HARDCODED blind macro(but once data are built, it is SOOOOOO powerful i cant replace it with anything else in the world). it is like DOS v3.3 command.com's edlin plus without display, you can't go back and change
ASK NAME A$
PRINT "old";" ";A$
END
why DUMB? it doesnt replace the macro key, it just adds next to it and the more i add, the more it consumes the real memory, in order to avoid this, i have to rewrite 100s key macros from the start without a mistake for several days with lots of headache. i have done several times back in the day, cant do no more, i'd rather hex-edit the macro file and reengineer and hack and rebuild the macro file if i ever knew how.

then it gets read by the startup file with this script command automatically
script ST2.

Post Reply