Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

Enhancing Batch-File Programming With a Disk-Stack and Its Operations

IP.com Disclosure Number: IPCOM000101757D
Original Publication Date: 1990-Aug-01
Included in the Prior Art Database: 2005-Mar-16
Document File: 3 page(s) / 96K

Publishing Venue

IBM

Related People

Lee, VH: AUTHOR

Abstract

Disclosed is the implementation of the stack-operations of a disk-stack, which can enhance the batch file programming under DOS and OS/2*.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 52% of the total text.

Enhancing Batch-File Programming With a Disk-Stack and Its Operations

       Disclosed is the implementation of the stack-operations
of a disk-stack, which can enhance the batch file programming under
DOS and OS/2*.

      Technically, batch files running under a second command
processor cannot alter the parent processor's environment. The CALL
command makes these batch files accomplish that by running them under
the parent processor.  It also makes it difficult to manage local
variables when recursive CALLs are involved.

      The command processor can implement an internal command for
creating a disk-stack object to deal with problems in saving and
restoring of local environment variables. Alternatively, a batch file
can accomplish the same purpose when it is executed under this
command processor.  This batch file sets reserved environment
variable DISKSTACK to the unique file name which will be the
disk-stack.  The time HHMMSSTT at which the file is created can be
used as file name to satisfy its uniqueness.  The disk-stack will be
in the root directory of the boot-disk.  In case the disk-stack is
created by batch file, any available disk can be used, but a RAM-disk
would be better.

      Three operations of the disk-stack are: EMPTY, PUSH and POP.
These operations are defined below:
      1.  EMPTY
          Syntax : EMPTY
          EMPTY truncates the disk-stack file to zero length. The
disk-stack file is indicated in variable DISKSTACK. No action if
DISKSTACK is not defined. EMPTY can be implemented as an internal
command, or a batch file EMPTY.BAT can be written for the same
purpose.
               IF "%DISKSTACK%" == "" QUIT
                REM > %DISKSTACK%
      2.  PUSH
          Syntax : PUSH [[VarName]...]
          PUSH gets the ASCIIZ string of variable  VarName and
appends it to the end of the disk-stack file. More variables can be
given to the PUSH command.  The first variable is pushed first, the
second next and so on. The entire ASCIIZ string of a variable is
appended.  If a variable is not defined, a null string (NUL
character) will be appended.  No action is performed if no variable
is given.
          PUSH can be implemented as an external command.  It can
obtain the environment variables of the command processor through its
copy of the environment.
      3. ...