Delphi Pages Forums

Delphi Pages Forums (
-   General (
-   -   Help with chdir !!!! Turbo Pascal vs Delphi (

TheDuke 01-03-2001 02:14 AM

Help with chdir !!!! Turbo Pascal vs Delphi
First of all i apologize for my bad english :P
i'm quite new to delphi so forgive the lame question too.

I'm writing a small console application.
The problem is: How to make delphi chdir work as sweet old TP chdir?

In turbopascal if i chdir('c:\windows'); when the program exit my current working directory is \windows

in delphi the directory change works only while the program is still running. When the program exit the Current Working Directory still is the one from which i launched my application.
I need it changed to c:\windows!!
anybody know how to achive that?

Thanks in advance.

PoseFant 01-03-2001 05:48 AM

RE: Help with chdir !!!! Turbo Pascal vs Delphi
This is because the ChDir Procedure, the SetCurrentDir and SetCurrentDirectory Functions are changing the directory in the active process.

Try the application code within a clean DOS environment, not a Command Shell within Windows.

If you start a Shell / Console within another Shell / Console, the memory handling will be separate for each Shell / Console.

There is API functions for controlling Consoles.

Read the SDK help file at Consoles and Character Mode Support.

I hope this helped you out ...



All times are GMT. The time now is 12:37 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.