XCOPY return code


If this is not the right group, please bear with me.
I have an application which calls XCOPY by means of
ShellExecute(). Everything works fine but I can't
solve the problem of how to receive feedback by the
function, i.e. when it has finished its job.

ShellExecute(... PChar('xcopy') ...);
ShowMessage('Done');

This returns immediately regardless of the copy process
still running or not.

if ShellExecute(..)
Posted On: Friday 5th of October 2012 11:50:46 PM Total Views:  112
View Complete with Replies

RELATED TOPICS OF Delphi Programming PROGRAMMING LANGUAGE




Functions that return TStrings

This is a overly simplistic scenario but I hope it explains my question. How does one go about freeing the TStringList created in the ReturnStrings function I've seen routines like this but wonder how to prevent a memory leak. function TForm1.ReturnStrings:TStrings; begin result := TStringList.Create; result.add('Testing'); end; procedure TForm1.Button1Click(Sender:TObject); begin Memo1.Lines.Assign(ReturnStrings); end;
VIEWS ON THIS POST

126

Posted on:

Saturday 22nd September 2012
View Replies!

function return array

, is it possible to write a function that return array of variant \t
VIEWS ON THIS POST

109

Posted on:

Wednesday 3rd October 2012
View Replies!

returning multi-dimentional arrays from functions

Hi: is it possible to return a multidemional array from a function if so how, if not I can pass the array as a parameter to the function. Sean.
VIEWS ON THIS POST

161

Posted on:

Wednesday 3rd October 2012
View Replies!

Is that possible to use function to return a procedural type?

I have a procedural type declare as: type TMyFunc = function(const a, b: integer): integer; And I have 2 functions: function Add(const a, b: integer): integer; begin Result := a + b; end; function Substract(const a, b: integer): integer; begin Result := a - b; end; I then declare a procedure to return one of function above: procedure GetProc(const aFlag: boolean; out aProc: TMyFunc); begin if aFlag then aProc := Add else aProc := Substract; end; I may then use the GetProc as: var P: TMyFunc; i: integer; begin GetProc(True, P); i := P(10, 15); end; The above code runs without as expected. However, if I want to change the GetProc to function that return TMyFunc: function GetFunc(const aFlag: boolean): TMyFunc; begin if aFlag then aProc := Add else aProc := Substract; end; And use it as: i := GetFunc(True)(10, 15); I get a compilation error: "E2066 Missing operator or semicolon". I may only use it as: i := TMyFunc(GetFunc(True))(10, 15); or var P: TMyFunc; i: integer; begin P := GetFunc(True); i := P(10, 15); end; Is this the correct way of using the function to return a procedural type Thank you. -- Best regards, Chau Chee Yang E Stream Software Sdn Bhd URL: www.sql.com.my SQL Financial Accounting
VIEWS ON THIS POST

127

Posted on:

Friday 5th October 2012
View Replies!