Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-21-2007, 05:29 AM
Simon180 Simon180 is offline
Senior Member
 
Join Date: Dec 2003
Posts: 187
Default VB To Delphi Help!

I been trying to convert abit of code from VB to delphi with no luck so am wondering if anyone can help me?

Code:
Private Sub cmdOpen_Click()

On Error GoTo errhandle
Shell ("C:\Program Files\Silkroad\sro_client.exe " & txtNumber.Text & " /18 0 0")

errhandle:

newpath = InputBox("I'm sorry, sro_client.exe not found on default location, please specify another location:", "Error!", "C:\Program Files\Silkroad\sro_client.exe")

Shell (newpath & " " & txtNumber.Text & " /18 0 0")

End Sub
and here my delphi convert

procedure TForm1.cmdOpenClick(Sender: TObject);
var
newpath: String;
Label errhandle;
begin
try

Shell( 'C:\Program Files\Silkroad\sro_client.exe '+txtNumber.text+' /18 0 0');

except

newpath := InputBox( 'I ''m sorry, sro_client.exe not found on default location, please specify another location:' , 'Error!' , 'C:\Program Files\Silkroad\sro_client.exe' );

Shell( newpath+' '+txtNumber.text+' /18 0 0');

end;
end;
[/code]


my problem is I can not work out how to get the Shell funcations working like the vb code can anyone help please?thanks alot
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 01:39 PM.


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