What is the equivalent code in vb? [modified]
-
What is the equivalent code in vb? This is Delphi code Thanks!
{
***** Process scheduling - FCFS, HRRN, SPN simulator ********
**
** Tested on Microsoft Windows XP SP2
**
** Written with Borland Delphi 7 Enterprise edition
**
*********************************************************
*******************************************************
* Greets:
**
** To my dear mother, father & anybody who supports me
**
******************************************************* }unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ExtCtrls, XPMan, ComCtrls;(****************************************************************************)
Type
TProcess=Record
Name:String;
ArrivalTime:Integer;
ServiceTime:Integer;
FinishTime:Integer;
TimeLeft:Integer;
Tq:Integer; {Turnaround time: total time in system, waiting + execution}
TqDivTs:Real; {Tq/Ts: Is the normalized turnaround time.
This value indicates the
relative delay experienced by a process.}
end;
(****************************************************************************)
Type TOrigin=Packed Record
X: Longint;
Y: Longint;
end;
(****************************************************************************)
Type
TForm1 = class(TForm)
XPManifest1: TXPManifest;
SaveDialog1: TSaveDialog;
SaveDialog2: TSaveDialog;
MemoService: TMemo;
Memo1: TMemo;
MemoArrival: TMemo;
MemoProcess: TMemo;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Image1: TImage;
BtnStart: TBitBtn;
btnSavePicture: TBitBtn;
btnSaveLog: TBitBtn;
ComboScheduling: TComboBox;
Label5: TLabel;
StatusBar1: TStatusBar;
procedure ComboSchedulingSelect(Sender: TObject);
procedure MemoArrivalKeyPress(Sender: TObject; var Key: Char);
procedure MemoServiceKeyPress(Sender: TObject; var Key: Char);
procedure BtnStartClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure btnSavePictureClick(Sender: TObject);
procedure btnSaveLogClick(Sender: TObject);
(****************************************************************************)
private
Procedure SortQueue;
Procedure CheckErrors;
Procedure ClearCanvas;
Procedure FilterNumericKeys(var Memo:TMemo;var Key:Char); // don't let to enter non-numeric keys -
What is the equivalent code in vb? This is Delphi code Thanks!
{
***** Process scheduling - FCFS, HRRN, SPN simulator ********
**
** Tested on Microsoft Windows XP SP2
**
** Written with Borland Delphi 7 Enterprise edition
**
*********************************************************
*******************************************************
* Greets:
**
** To my dear mother, father & anybody who supports me
**
******************************************************* }unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ExtCtrls, XPMan, ComCtrls;(****************************************************************************)
Type
TProcess=Record
Name:String;
ArrivalTime:Integer;
ServiceTime:Integer;
FinishTime:Integer;
TimeLeft:Integer;
Tq:Integer; {Turnaround time: total time in system, waiting + execution}
TqDivTs:Real; {Tq/Ts: Is the normalized turnaround time.
This value indicates the
relative delay experienced by a process.}
end;
(****************************************************************************)
Type TOrigin=Packed Record
X: Longint;
Y: Longint;
end;
(****************************************************************************)
Type
TForm1 = class(TForm)
XPManifest1: TXPManifest;
SaveDialog1: TSaveDialog;
SaveDialog2: TSaveDialog;
MemoService: TMemo;
Memo1: TMemo;
MemoArrival: TMemo;
MemoProcess: TMemo;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Image1: TImage;
BtnStart: TBitBtn;
btnSavePicture: TBitBtn;
btnSaveLog: TBitBtn;
ComboScheduling: TComboBox;
Label5: TLabel;
StatusBar1: TStatusBar;
procedure ComboSchedulingSelect(Sender: TObject);
procedure MemoArrivalKeyPress(Sender: TObject; var Key: Char);
procedure MemoServiceKeyPress(Sender: TObject; var Key: Char);
procedure BtnStartClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure btnSavePictureClick(Sender: TObject);
procedure btnSaveLogClick(Sender: TObject);
(****************************************************************************)
private
Procedure SortQueue;
Procedure CheckErrors;
Procedure ClearCanvas;
Procedure FilterNumericKeys(var Memo:TMemo;var Key:Char); // don't let to enter non-numeric keysThis is only the interface, there should also be a part that describes the implementation. As is, your code is incomplete and can't be translated. To explain it in .NET terms, these are merely prototypes that describe the actual implementation. We have a Delphi-forum - try there, and include the implementation if you need a translation. Keep in mind that translations aren't a service that the site offers; you can expect more help if you post a specific question.
I are Troll :suss:
-
This is only the interface, there should also be a part that describes the implementation. As is, your code is incomplete and can't be translated. To explain it in .NET terms, these are merely prototypes that describe the actual implementation. We have a Delphi-forum - try there, and include the implementation if you need a translation. Keep in mind that translations aren't a service that the site offers; you can expect more help if you post a specific question.
I are Troll :suss:
Hi How are you? Thank you for the answer. If the code is complete? { ***** Process scheduling - FCFS, HRRN, SPN simulator ******** ** ** Tested on Microsoft Windows XP SP2 ** ** Written with Borland Delphi 7 Enterprise edition ** ******************************************************* * Programmer: ** ** ******************************************************* * Greets: ** ** To my dear mother, father & anybody who supports me ** ******************************************************* } unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons, ExtCtrls, XPMan, ComCtrls; (****************************************************************************) Type TProcess=Record Name:String; ArrivalTime:Integer; ServiceTime:Integer; FinishTime:Integer; TimeLeft:Integer; Tq:Integer; {Turnaround time: total time in system, waiting + execution} TqDivTs:Real; {Tq/Ts: Is the normalized turnaround time. This value indicates the relative delay experienced by a process.} end; (****************************************************************************) Type TOrigin=Packed Record X: Longint; Y: Longint; end; (****************************************************************************) Type TForm1 = class(TForm) XPManifest1: TXPManifest; SaveDialog1: TSaveDialog; SaveDialog2: TSaveDialog; MemoService: TMemo; Memo1: TMemo; MemoArrival: TMemo; MemoProcess: TMemo; Label1: TLabel; Label2: TLabel; Label3: TLabel; Image1: TImage; BtnStart: TBitBtn; btnSavePicture: TBitBtn; btnSaveLog: TBitBtn; ComboScheduling: TComboBox; Label5: TLabel; StatusBar1: TStatusBar; procedure ComboSchedulingSelect(Sender: TObject); procedure MemoArrivalKeyPress(Sender: TObject; var Key: Char); procedure MemoServiceKeyPress(Sender: TObject; var Key: Char); procedure BtnStartClick(Sender: TObject); procedure FormCreate(Sender: TObject); procedure btnSavePictureClick(Sender: TObject); procedure btnSaveLogClick(Sender: TObject); (****************************************************************************) private Procedure SortQueue; Procedure CheckErrors; Procedure ClearCanvas; Procedure FilterNumericKeys(var Memo:TMemo;var Key:Char); // don't let to enter non-nu
-
This is only the interface, there should also be a part that describes the implementation. As is, your code is incomplete and can't be translated. To explain it in .NET terms, these are merely prototypes that describe the actual implementation. We have a Delphi-forum - try there, and include the implementation if you need a translation. Keep in mind that translations aren't a service that the site offers; you can expect more help if you post a specific question.
I are Troll :suss:
How are you? Thank you for the answer. If the code is complete? This code is complete. this is delphi project http://www18.zippyshare.com/v/70783499/file.html[^] this is text file http://www18.zippyshare.com/v/94346699/file.html[^]
-
Hi How are you? Thank you for the answer. If the code is complete? { ***** Process scheduling - FCFS, HRRN, SPN simulator ******** ** ** Tested on Microsoft Windows XP SP2 ** ** Written with Borland Delphi 7 Enterprise edition ** ******************************************************* * Programmer: ** ** ******************************************************* * Greets: ** ** To my dear mother, father & anybody who supports me ** ******************************************************* } unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons, ExtCtrls, XPMan, ComCtrls; (****************************************************************************) Type TProcess=Record Name:String; ArrivalTime:Integer; ServiceTime:Integer; FinishTime:Integer; TimeLeft:Integer; Tq:Integer; {Turnaround time: total time in system, waiting + execution} TqDivTs:Real; {Tq/Ts: Is the normalized turnaround time. This value indicates the relative delay experienced by a process.} end; (****************************************************************************) Type TOrigin=Packed Record X: Longint; Y: Longint; end; (****************************************************************************) Type TForm1 = class(TForm) XPManifest1: TXPManifest; SaveDialog1: TSaveDialog; SaveDialog2: TSaveDialog; MemoService: TMemo; Memo1: TMemo; MemoArrival: TMemo; MemoProcess: TMemo; Label1: TLabel; Label2: TLabel; Label3: TLabel; Image1: TImage; BtnStart: TBitBtn; btnSavePicture: TBitBtn; btnSaveLog: TBitBtn; ComboScheduling: TComboBox; Label5: TLabel; StatusBar1: TStatusBar; procedure ComboSchedulingSelect(Sender: TObject); procedure MemoArrivalKeyPress(Sender: TObject; var Key: Char); procedure MemoServiceKeyPress(Sender: TObject; var Key: Char); procedure BtnStartClick(Sender: TObject); procedure FormCreate(Sender: TObject); procedure btnSavePictureClick(Sender: TObject); procedure btnSaveLogClick(Sender: TObject); (****************************************************************************) private Procedure SortQueue; Procedure CheckErrors; Procedure ClearCanvas; Procedure FilterNumericKeys(var Memo:TMemo;var Key:Char); // don't let to enter non-nu
Milad.Biroonvand wrote:
If the code is complete?
I'm sorry, but that's a bit much too translate - you'll need someone who speaks either language. Most constructs, like the SaveDialog, are available in both languages. To give you an idea of what needs be done;
Procedure TForm1.btnSavePictureClick(Sender: TObject);
begin
If SaveDialog1.Execute then
Image1.Picture.SaveToFile(SaveDialog1.FileName);
end;private void Form1_btnSavePictureClick(Object sender, EventArgs e) // private, because it's omitted in the interface-section,
{ // and Delphi defaults to private too.
if (saveFileDialog1.ShowDialog() == DialogResult.OK) // Assuming a saveFileDialog control on the form
pictureBox1.Image.Save(saveFileDialog1.FileName);
}Look like old relatives, don't they? :) We'll be available for further help if you get stuck on making the translation.
I are Troll :suss: