Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. What is the equivalent code in vb? [modified]

What is the equivalent code in vb? [modified]

Scheduled Pinned Locked Moved Visual Basic
delphiquestiongraphics
5 Posts 2 Posters 6 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Milad Biroonvand
    wrote on last edited by
    #1

    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

    L 1 Reply Last reply
    0
    • M Milad Biroonvand

      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

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      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:

      M 2 Replies Last reply
      0
      • L Lost User

        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:

        M Offline
        M Offline
        Milad Biroonvand
        wrote on last edited by
        #3

        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

        L 1 Reply Last reply
        0
        • L Lost User

          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:

          M Offline
          M Offline
          Milad Biroonvand
          wrote on last edited by
          #4

          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[^]

          1 Reply Last reply
          0
          • M Milad Biroonvand

            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

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            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:

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups