🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.msdos.misc
1 messages
1 total messages Started by John Savage Thu, 28 Sep 1995 00:00
In batch files, how to eval a variable?
#3957
Author: John Savage
Date: Thu, 28 Sep 1995 00:00
19 lines
1412 bytes
I know MSDOS is rudimentary, but I try to get the most out of it ...

When I give a .BAT file an argument which is the name of an environment
variable, it would often be useful to be able to determine the value of
that variable within the batch script. Unix provides this with the EVAL
function, but in DOS I can't do it without writing to a file (or passing
the value in as a second argument).

e.g.,  SET I=45
       CALL FF1 I

       { in FF1, %1 has the value of I, but
         I would like to use something like
         %(%1)% and have it evaluate to 45  }

Has anyone discovered a nifty way to do this using pure MSDOS and
without writing to, then executing, a second batch file?
--
John Savage               koala@sydney.dialix.com.au
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads