[comp.lang.pascal] Pascal Question

JTW106@PSUVM.BITNET (Jeff Wolfe) (11/30/89)

While using TP 5.0's EXEC command, the program seems to 'skip' over the EXEC
statement. I am using the $M compiler directive, but it still won't work.

 the program:

program testEXEC;

{$M $4000,0,0}
 uses DOS;

begin
 exec ('Command.com','');
end.

and Command.com *IS* in the same directory as the program for this test!

Does anyone have any Ideas? (please Email me, and I'll post a summary)

-------
                                                     Jeff Wolfe
  JTW106@psuvm.psu.edu                               114 Lake St.
  JTW106@psuvm.BITNET                                Dalton, PA. 18414

"A Computer's efficiency decreases as the urgency of retrieval increases"

reino@cs.eur.nl (Reino de Boer) (12/01/89)

JTW106@PSUVM.BITNET (Jeff Wolfe) writes:


>While using TP 5.0's EXEC command, the program seems to 'skip' over the EXEC
>statement. I am using the $M compiler directive, but it still won't work.

> the program:

>program testEXEC;

>{$M $4000,0,0}
> uses DOS;

>begin
> exec ('Command.com','');
>end.

>and Command.com *IS* in the same directory as the program for this test!

>Does anyone have any Ideas? (please Email me, and I'll post a summary)

I have tried the following:
{$M $4000,0,0}
program testEXEC;
uses  dos;
begin
  exec( 'c:\command.com', '' );
  if doserror <> 0 then
    writeln( 'DosError[', doserror, ']: something went wrong' )
end.
and this works fine on my machine (that is, I get no doserrors, and I do
get a command shell).

Hope this helps -- Reino

-- 
Reino R. A. de Boer
Erasmus University Rotterdam ( Informatica )
e-mail: reino@cs.eur.nl

ts@uwasa.fi (Timo Salmi LASK) (12/01/89)

In article <89334.082120JTW106@PSUVM.BITNET> JTW106@PSUVM.BITNET (Jeff Wolfe) writes:
>While using TP 5.0's EXEC command, the program seems to 'skip' over the EXEC
>statement. I am using the $M compiler directive, but it still won't work.
>program testEXEC;
>{$M $4000,0,0}
> uses DOS;
>begin
> exec ('Command.com','');
>end.

Ah, but it does work.  You just have to tell within '' what you want
done.  And, please see the example for Exec in the reference manual
so that you won't omit the \C that the command.com requires. 

...................................................................
Prof. Timo Salmi                                (Site 128.214.12.3)
School of Business Studies, University of Vaasa, SF-65101, Finland
Internet: ts@chyde.uwasa.fi Funet: vakk::salmi Bitnet: salmi@finfun

andyross@ddsw1.MCS.COM (Andrew Rossmann) (12/02/89)

>>While using TP 5.0's EXEC command, the program seems to 'skip' over the EXEC
>>statement. I am using the $M compiler directive, but it still won't work.
>>program testEXEC;
>>{$M $4000,0,0}
>> uses DOS;
>>begin
>> exec ('Command.com','');
>>end.
>

  You should put a SwapVectors before and after every Exec call.

begin
SwapVectors;
Exec(GetEnv('COMSPEC'), '');
SwapVectors;
end.

  The SwapVectors restores several interrupts that Turbo Pascal grabs. If
they still point to TP, you could have problems.
  You ideally should also use the COMSPEC environment variable when call
COMMAND.COM, since it may not be in a normal place. It could (as in my
case) be 4DOS.COM instead!

  Andrew Rossmann
  andyross@ddsw1.MCS.COM

gjc@portia.Stanford.EDU (George J. Chen) (01/04/90)

I'm posting the following for a friend, please respond to him
directly.  
****************************************************************
In a Pascal program, how do I draw text at a right angle to normal
horizontal screen display, for example to label the vertical axis of a
graph?  I don't believe that it is supported by Quickdraw.

Please mail responses (examples would be greatly appreciated) to

      olpe@bigbopper.etdesg.trw.com

Thanks.
                            Mike Schwartz

****************************************************************

-- 
George J. Chen
gjc@portia.stanford.edu