Results 1 to 3 of 3

Thread: Form Troubles

  1. #1
    Join Date
    Jun 2007
    Location
    Kentucky, United States of America
    Posts
    409
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Form Troubles

    Ok, I'm pretty new at scripting, and I'm trying to make a simple player username & pass form.

    I keep getting an error at line 8, that a 'Begin" is expected in the script, but it's already there.

    Any idea what's wrong?

    Here it is.

    SCAR Code:
    program UserLoginForm

    var
    frmDesign : TForm;
      UserName : TLabel;
      Password : TLabel;
      Button1 : TButton;
      Edit1 : TEdit;
       : TEdit;
    begin

    procedure InitForm

    frmDesign := CreateForm;
    frmDesign.Left := 250;
    frmDesign.Top := 114;
    frmDesign.Width := 696;
    frmDesign.Height := 480;
    frmDesign.Cursor := crHandPoint;
    frmDesign.BorderIcons := [biSystemMenu, biMinimize];
    frmDesign.Caption := 'Username & Password Input';
    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;
    UserName := TLabel.Create(frmDesign);
    UserName.Parent := frmDesign;
    UserName.Left := 102;
    UserName.Top := 27;
    UserName.Width := 50;
    UserName.Height := 13;
    UserName.Caption := 'UserName';
    Password := TLabel.Create(frmDesign);
    Password.Parent := frmDesign;
    Password.Left := 102;
    Password.Top := 97;
    Password.Width := 46;
    Password.Height := 13;
    Password.Caption := 'Password';
    Button1 := TButton.Create(frmDesign);
    Button1.Parent := frmDesign;
    Button1.Left := 321;
    Button1.Top := 381;
    Button1.Width := 75;
    Button1.Height := 25;
    Button1.Caption := '&Submit';
    Button1.TabOrder := 8;
    Edit1 := TEdit.Create(frmDesign);
    Edit1.Parent := frmDesign;
    Edit1.Left := 102;
    Edit1.Top := 49;
    Edit1.Width := 121;
    Edit1.Height := 21;
    Edit1.TabOrder := 9;
     := TEdit.Create(frmDesign);
    .Parent := frmDesign;
    .Left := 102;
    .Top := 118;
    .Width := 121;
    .Height := 21;
    .PasswordChar := #1;
    .TabOrder := 10;
    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;
      SafeShowFormModal;
    end.

  2. #2
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,347
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    SCAR Code:
    program UserLoginForm;
     
    var
    frmDesign : TForm;
      UserName : TLabel;
      Password : TLabel;
      Button1 : TButton;
      Edit1 : TEdit;
      Edit2 : TEdit;

     
    procedure InitForm
    begin
    frmDesign := CreateForm;
    frmDesign.Left := 250;
    frmDesign.Top := 114;
    frmDesign.Width := 696;
    frmDesign.Height := 480;
    frmDesign.Cursor := crHandPoint;
    frmDesign.BorderIcons := [biSystemMenu, biMinimize];
    frmDesign.Caption := 'Username & Password Input';
    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;
    UserName := TLabel.Create(frmDesign);
    UserName.Parent := frmDesign;
    UserName.Left := 102;
    UserName.Top := 27;
    UserName.Width := 50;
    UserName.Height := 13;
    UserName.Caption := 'UserName';
    Password := TLabel.Create(frmDesign);
    Password.Parent := frmDesign;
    Password.Left := 102;
    Password.Top := 97;
    Password.Width := 46;
    Password.Height := 13;
    Password.Caption := 'Password';
    Button1 := TButton.Create(frmDesign);
    Button1.Parent := frmDesign;
    Button1.Left := 321;
    Button1.Top := 381;
    Button1.Width := 75;
    Button1.Height := 25;
    Button1.Caption := '&Submit';
    Button1.TabOrder := 8;
    Edit1 := TEdit.Create(frmDesign);
    Edit1.Parent := frmDesign;
    Edit1.Left := 102;
    Edit1.Top := 49;
    Edit1.Width := 121;
    Edit1.Height := 21;
    Edit1.TabOrder := 9;
    Edit2 := TEdit.Create(frmDesign);
    Edit2.Parent := frmDesign;
    Edit2.Left := 102;
    Edit2.Top := 118;
    Edit2.Width := 121;
    Edit2.Height := 21;
    Edit2.PasswordChar := '*';
    Edit2.TabOrder := 10;
    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;
      SafeShowFormModal;
    end.
    Interested in C# and Electrical Engineering? This might interest you.

  3. #3
    Join Date
    Jun 2007
    Location
    Kentucky, United States of America
    Posts
    409
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Oh. . .duh thanks, can't believe I didn't notice all the little mistakes there. . .didn't name the second Tedit, forgot the semi-colon after the program name, and the Edit2's at the end of the InitForm Procedure. . .thanks.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Dev C++ and troubles?
    By insanomano in forum C/C++ Help and Tutorials
    Replies: 12
    Last Post: 11-01-2008, 09:28 AM

Posting Permissions

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