[comp.lang.c] Turbo C Question

bonak%cs.uiowa.edu@RELAY.CS.NET (Esmail Bonakdarian) (09/03/87)

Thanks to all who responded - both questions were answered.
The double \\ in the path specification did the trick and
I was able to use ERRORLEVEL in a batch file to utilize the
return value of the exit call.

Thanks again,

Esmail

jerry@starfish.Convergent.COM (Gerald Hawkins) (11/13/88)

I've been trying to use the 'system()' function call in my turbo c
programs, just as I've always been able to do with Un*x and the cc
compiler.

After a great deal of pain and suffering, I've found that code such as
this:

#include <stdio.h>
#include <conio.h>
#include <process.h>

main()
{
	int		a;

	a = system("dir a:");

	if (!(a))
		printf("\nSystem call successful");
	else
		printf("\nsystem call error");
}

does not work within the turbo c integrated environment.  However, if I
compile the code, exit the integrated environment, and run the code, the
result is correct, ie, the directory is listed and the system call
successful is displayed.

(When running it within tc2.0, the system() call never really seems to
happen, but a does get set to zero, indicating a successful call!  The
System call successful message prints).

I havn't contacted Borland yet.  Does anybody out there know how to make
this work from within the tc environment?


Rainy Days and
Automatic Weapons Fire
Alway Get Me Down.

These opinions are mine.
Jerry.  (jerry@starfish.convergent.COM)
-----

Don_A_Corbitt@cup.portal.com (11/14/88)

>I've been trying to use the 'system()' function call in my turbo c
>
>main()
>{
>	int		a;
>
>	a = system("dir a:");
>
>	if (!(a))
>		printf("\nSystem call successful");
>	else
>		printf("\nsystem call error");
>}
>(When running it within tc2.0, the system() call never really seems to
>happen, but a does get set to zero, indicating a successful call!  The
>System call successful message prints).
>Jerry.  (jerry@starfish.convergent.COM)
Sounds like your problem is insufficient memory.  There is a bug in TC2.0
where the system() call doesn't return an error if insufficient memory to load 
command.com.  The work-around is to check errno after the call to system.  Errno
is set properly.  (Be sure to set errno=0; before calling system().)
	Don_A_Corbitt@cup.portal.com
	CrystalGraphics, Inc.
-----

scott@bbxsda.UUCP (Scott Amspoker) (10/13/89)

I have a stange question about Turbo C.

I am doing a realtime MIDI application (using Turbo C) with an
interval timer interrupting about once a millisecond.  I noticed 
while doing an experiment one evening that fewer "ticks" were taking 
place over the period of about a minute than expected.  After considerable
investigation I determined that the less output I did to the screen,
the more accurate my counter.  If I did no output at all, the timer
was accurate down to the tick.  I concluded that something in the
putch() call in Turbo C was causing me to miss an occasional interrupt.
I figured this would happen if they had disabled the interrupts for
longer than one of my timer intervals.

Does this make sense?  The machine I am using is a Yamaha C1 which is
*extremely* compatible with a 286-based PC.  However, its LCD display
looks like a CGA to the software.  Is it possible putch() is waiting
for the horizontal retrace with the interrupts disabled?  This is not
necessary as it was with older CGA's.

Thanks

-- 
Scott Amspoker
Basis International, Albuquerque, NM
(505) 345-5232
unmvax.cs.unm.edu!bbx!bbxsda!scott

dpavlich@mcs.mcs.kent.edu (Dave Pavlich) (02/28/91)

  In Turbo C how can I remove the cursor from the Text-Screen. Is there a 
 function that will do it for me  ?  

 Thanks In Advance..

 Dave Pavlich
 Kent State University

  Please relpy to dpavlich@mcs.kent.edu