Results 1 to 2 of 2

Thread: My Form Crashes Scar

  1. #1
    Join Date
    Jan 2008
    Location
    U.S.A
    Posts
    313
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default My Form Crashes Scar

    Hey I just Made a Form I'll Show it, When I click start to See if Form loads it loads but then Scar Crashes everytime!!! Here's The Form
    SCAR Code:
    program New;

    var
      frmDesign : TForm;
      UserLabel : TLabel;
      PassLabel : TLabel;
      UsernameLabel : TEdit;
      PasswordEdit : TEdit;
      StartScriptButton : TButton;
      Username, Password : String;

     

      procedure StartClick(sender: TObject);
    begin
      Writeln('Hey Jagex Abuser!');
      Username := UsernameLabel.Text;
      Password := PasswordEdit.Text;
      WriteLn('Username = ' + Username);
      Writeln('Password = ' + Password);
      frmDesign.ModalResult:= mrOk; // Closes the form
    end;




      Procedure Initform;
    begin
    frmDesign := CreateForm;
    frmDesign.Left := 250;
    frmDesign.Top := 114;
    frmDesign.Width := 696;
    frmDesign.Height := 480;
    frmDesign.Caption := 'frmDesign';
    frmDesign.Color := clBtnFace;
    frmDesign.Font.Color := clWindowText;
    frmDesign.Font.Height := -11;
    frmDesign.Font.Name := 'MS Sans Serif';
    frmDesign.Font.Style := [];
    frmDesign.Visible := False;
    frmDesign.PixelsPerInch := 96;
    UserLabel := TLabel.Create(frmDesign);
    UserLabel.Parent := frmDesign;
    UserLabel.Left := 136;
    UserLabel.Top := 96;
    UserLabel.Width := 48;
    UserLabel.Height := 13;
    UserLabel.Caption := 'Username';
    PassLabel := TLabel.Create(frmDesign);
    PassLabel.Parent := frmDesign;
    PassLabel.Left := 136;
    PassLabel.Top := 128;
    PassLabel.Width := 46;
    PassLabel.Height := 13;
    PassLabel.Caption := 'Password';
    UsernameLabel := TEdit.Create(frmDesign);
    UsernameLabel.Parent := frmDesign;
    UsernameLabel.Left := 200;
    UsernameLabel.Top := 96;
    UsernameLabel.Width := 121;
    UsernameLabel.Height := 21;
    UsernameLabel.TabOrder := 8;
    UsernameLabel.Text := 'UsernameLabel';
    PasswordEdit := TEdit.Create(frmDesign);
    PasswordEdit.Parent := frmDesign;
    PasswordEdit.Left := 200;
    PasswordEdit.Top := 128;
    PasswordEdit.Width := 121;
    PasswordEdit.Height := 21;
    PasswordEdit.TabOrder := 9;
    PasswordEdit.Text := 'PasswordEdit';
    StartScriptButton := TButton.Create(frmDesign);
    StartScriptButton.Parent := frmDesign;
    StartScriptButton.Left := 200;
    StartScriptButton.Top := 320;
    StartScriptButton.Width := 75;
    StartScriptButton.Height := 25;
    StartScriptButton.Caption := 'Start Script';
    StartScriptButton.TabOrder := 10;
    StartScriptButton.OnClick := @StartClick;
    end;


    procedure SafeInitForm;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('InitForm', v);
    end;

    procedure ShowFormModal;
    begin
      frmDesign.ShowModal;
    end;


    procedure SafeShowFormModal;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('ShowFormModal', v);
    end;


    begin
    SafeInitForm;
    ShowFormModal;
    end.

    So What's Wrong???? =(
    Will test most scripts, offering members account to certain scripters! PM Me.
    Also need helping making a powerminer, Pst/Aim me!

  2. #2
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    You need to call SafeShowFormModal rather than just ShowFormModal in your main loop
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •