delorie.com/archives/browse.cgi   search  
Mail Archives: opendos/2002/01/03/06:22:49

X-Authentication-Warning: delorie.com: mailnull set sender to opendos-bounces using -f
From: "Paulo Santana" <san AT formata DOT com DOT br>
To: <opendos AT delorie DOT com>
Subject: RE: on a related note
Date: Thu, 3 Jan 2002 09:22:33 -0200
Message-ID: <004401c19448$f0420820$b7e3a2c8@ajato.com.br>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
In-Reply-To: <Pine.GSO.4.33.0201032104370.24488-100000@jedi.apana.org.au>
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Importance: Normal
X-MIME-Autoconverted: from Quoted-Printable to 8bit by delorie.com id g03BMiM24520
Reply-To: opendos AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: opendos AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

DP> My next obstacle is passing more than 9 parameters to it - any ideas?

Ops. Now I noticed you have to pass the parameters from inside a Pascal
program. You have two options:

1. Find a procedure to set DOS environment variables from Pascal. You should
find that easily at SWAG or the Turbo Pascal Programmer's Page
(http://www.cs.vu.nl/~jprins/tp.html);

2. What always worked for me was to actually make the Pascal program WRITE
the batch file I was going to call, so that I could create it with all the
parameters set. So, arguably, you could write a batch file like this:

Var
  T : Text;
  Param10, Param11 : String;

  Assign (T,"PREPENV.BAT");
  Rewrite (T);

  If (IOResult = 0) then
  Begin
    Writeln (T,'SET PARAM10=' + Param10);
    Writeln (T,'SET PARAM11=' + Param11);
    Writeln (T,'CALL MYBAT.BAT');
    Close (T);
  End;

And then you'd call "PREPENV.BAT" from your Pascal program, which would set
the environment variables, and then call your original batch file in turn.

Of course that, now knowing this, you could actually write the whole batch
file self-contained, with no need to pass parameters at all. It's your call
to develop from there.

Atenciosamente,
Paulo Santana

-------------------------------------------------------
dataSafe Web                                  MicroSafe
Gerenciando, protegendo e       Microinformática levada
recuperando seus dados         a sério, de APC a XIRCOM
-------------------------------------------------------
(0xx21) 2258-9056                     (0xx21) 2258-8862
BRU Btrieve DR DOS UltiROUTE   Preços e cotações online
info AT datasafeweb DOT com DOT br         vendas AT microsafe DOT com DOT br
www.datasafeweb.com.br             www.microsafe.com.br
-------------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019