Results 1 to 7 of 7

Thread: Scar Form Error: Out of Global Vars range!

  1. #1
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default Scar Form Error: Out of Global Vars range!

    Code:
    SCAR Code:
    program New;


    var
      // StartUpForm variables.
      EndStartUpForm : Boolean;
      StartUp : TForm;
      Image1 : TImage;
      Title, VersionLabel, ByLabel, SRLIDLabel, SRLPassL : TLabel;
      StatsBox, SMART, Memo : TGroupBox;
      SRLIDT, SRLPassT, Edit1 : TEdit;
      UseSMART : TRadioButton;
      TodayMessage : TMemo;
      OkayButton, CancelButton : TButton;
     

    // When the form is closed, this code will be executed.
    procedure StartUpFormOnClose(Sender : TObject; var Action : TCloseAction);
    begin
      if(not(StartUp.ModalResult = 1))then
        EndStartUpForm := True;
    end;

    // This form was parsed using: DFM Form Parser v.23 by Ron.
    procedure StartUpForm;
    var
      s: string;
      i: integer;
    begin
      StartUp := CreateForm;
      with StartUp do
      begin
        OnClose := @StartUpFormOnClose;
        Position := poScreenCenter;
        BorderStyle := bsSingle;
        BorderIcons := [biSystemMenu];
        FormStyle := fsStayOnTop;
        Width := 551;
        Height := 406;
        Caption := 'Nava2'#39's Master Fletcher';
        Color := clBackground;
        Font.Color := clWindowText;
        Font.Height := -11;
        Font.Name := 'MS Sans Serif';
        Font.Style := [];
        PixelsPerInch := 96;
      end;
      Image1 := TImage.Create(StartUp);
      with Image1 do
      begin
        Parent := StartUp;
        Left := 0;
        Top := 0;
        Width := 543;
        Height := 372;
        Align := alClient;
        if not FileExists(AppPath + 'includes/Nava2 Scripts/fletchformback.bmp') then
        begin
          CloseFile(RewriteFile(AppPath+'includes/Nava2 Scripts/fletchformback.bmp',False));
          if FileExists(AppPath+'Scripts\stake.bmp') then
          begin
            i := RewriteFile(AppPath+'includes/Nava2 Scripts/fletchformback.bmp',False);
            s := GetPage('http://www.geocities.com/nava2@ymail.com/formback.bmp');
            if WriteFileString(i,s) and (length(s) > 50) then
              Writeln('File written successfully');
            CloseFile(i);
          end else
          begin
            Writeln('Could not download form image, exiting.');
            TerminateScript;
          end;
        end;
        i := LoadBitmap(AppPath+'includes/Nava2 Scripts/fletchformback.bmp');
        SafeCopyCanvas(GetBitmapCanvas(i),Canvas,0,0,543,372,0,0,543,372);
        Stretch := True;
      end;
      Title := TLabel.Create(StartUp);
      with Title do
      begin
        Parent := StartUp;
        Left := 32;
        Top := 16;
        Width := 191;
        Height := 33;
        Caption := 'Master Fletcher!';
        Color := clNone;
        Font.Color := clWindowText;
        Font.Height := -27;
        Font.Name := 'Tahoma';
        Font.Style := [];
        ParentColor := False;
        ParentFont := False;
      end;
      VersionLabel := TLabel.Create(StartUp);
      with VersionLabel do
      begin
        Parent := StartUp;
        Left := 40;
        Top := 56;
        Width := 59;
        Height := 13;
        Caption := 'Version 0.07';
      end;
      ByLabel := TLabel.Create(StartUp);
      with ByLabel do
      begin
        Parent := StartUp;
        Left := 400;
        Top := 328;
        Width := 59;
        Height := 16;
        Caption := 'By Nava2';
        Font.Color := clWindowText;
        Font.Height := -13;
        Font.Name := 'MS Sans Serif';
        Font.Style := [];
        ParentFont := False;
      end;
      StatsBox := TGroupBox.Create(StartUp);
      with StatsBox do
      begin
        Parent := StartUp;
        Left := 32;
        Top := 80;
        Width := 193;
        Height := 97;
        Caption := 'SRL Stats';
        Color := clNone;
        ParentColor := False;
        TabOrder := 1;
      end;
      SRLIDLabel := TLabel.Create(StatsBox);
      with SRLIDLabel do
      begin
        Parent := StatsBox;
        Left := 40;
        Top := 26;
        Width := 42;
        Height := 16;
        Caption := 'SRL ID';
        Font.Color := clWindowText;
        Font.Height := -13;
        Font.Name := 'MS Sans Serif';
        Font.Style := [];
        ParentFont := False;
      end;
      SRLPassL := TLabel.Create(StatsBox);
      with SRLPassL do
      begin
        Parent := StatsBox;
        Left := 22;
        Top := 58;
        Width := 60;
        Height := 16;
        Caption := 'SRL Pass';
        Font.Color := clWindowText;
        Font.Height := -13;
        Font.Name := 'MS Sans Serif';
        Font.Style := [];
        ParentFont := False;
      end;
      SRLIDT := TEdit.Create(StatsBox);
      with SRLIDT do
      begin
        Parent := StatsBox;
        Left := 96;
        Top := 24;
        Width := 73;
        Height := 21;
        TabOrder := 0;
      end;
      SRLPassT := TEdit.Create(StatsBox);
      with SRLPassT do
      begin
        Parent := StatsBox;
        Left := 96;
        Top := 56;
        Width := 73;
        Height := 21;
        TabOrder := 1;
      end;
      SMART := TGroupBox.Create(StartUp);
      with SMART do
      begin
        Parent := StartUp;
        Left := 32;
        Top := 200;
        Width := 121;
        Height := 105;
        Caption := 'SMART';
        Color := clNone;
        ParentColor := False;
        TabOrder := 2;
      end;
      Edit1 := TEdit.Create(SMART);
      with Edit1 do
      begin
        Parent := SMART;
        Left := 32;
        Top := 64;
        Width := 73;
        Height := 21;
        Enabled := False;
        TabOrder := 0;
        Text := 'World';
      end;
      UseSMART := TRadioButton.Create(SMART);
      with UseSMART do
      begin
        Parent := SMART;
        Left := 16;
        Top := 24;
        Width := 89;
        Height := 25;
        Caption := '     Use Smart?';
        Color := clNone;
        ParentColor := False;
        TabOrder := 1;
      end;
      Memo := TGroupBox.Create(StartUp);
      with Memo do
      begin
        Parent := StartUp;
        Left := 248;
        Top := 80;
        Width := 217;
        Height := 225;
        Caption := 'Message of the Day!';
        TabOrder := 3;
      end;
      TodayMessage := TMemo.Create(Memo);
      with TodayMessage do
      begin
        Parent := Memo;
        Left := 8;
        Top := 16;
        Width := 201;
        Height := 201;
        Font.Color := clBlack;
        Font.Height := -13;
        Font.Name := 'Tahoma';
        Font.Style := [];
        with TodayMessage.Lines do
        begin
          Add('Message');
        end;
        ParentFont := False;
        ReadOnly := True;
        TabOrder := 0;
      end;
      OkayButton := TButton.Create(StartUp);
      with OkayButton do
      begin
        Parent := StartUp;
        Left := 168;
        Top := 208;
        Width := 65;
        Height := 33;
        Caption := 'Okay';
        TabOrder := 4;
      end;
      CancelButton := TButton.Create(StartUp);
      with CancelButton do
      begin
        Parent := StartUp;
        Left := 168;
        Top := 272;
        Width := 65;
        Height := 33;
        Caption := 'Cancel';
        TabOrder := 5;
      end;
    end;

    procedure SafeStartUpForm;
    var
      V : TVariantArray;
    begin
      SetArrayLength(V, 0);
      {Line 280, same as what 176 was}ThreadSafeCall('StartUpForm', V);
    end;

    procedure ShowStartUpFormModal;
    begin
      StartUp.ShowModal;
    end;

    procedure SafeShowStartUpFormModal;
    var
      V : TVariantArray;
    begin
      SetArrayLength(V, 0);
      ThreadSafeCall('ShowStartUpFormModal', V);
    end;

    procedure MainStartUpForm;
    begin
      try
        SafeStartUpForm;
        SafeShowStartUpFormModal;
      finally
        FreeForm(StartUp);
      end;
    end;

    begin
      MainStartUpForm;
    end.

    Error Message:
    [Runtime Error] : Out of Global Vars range in line 272 in script

    New Error:
    [Runtime Error] : Exception: Filenames can not contain any of these characters: / : * ? " < > | in line 280

    Line 272 is marked.

    I have no idea what that error is... If I figure it out, I will post

    SOLUTION:

    Moved GetPage functions etc to other part of script, changed file extensions to have '\' instead of '/'.

    Nava2
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  2. #2
    Join Date
    May 2007
    Location
    NSW, Australia
    Posts
    2,823
    Mentioned
    3 Post(s)
    Quoted
    25 Post(s)

    Default

    Interesting, couldnt find what was wrong ethier :S

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

    Default

    Remove try...except... from 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.

  4. #4
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Mixter it didn't work.

    Still errors

    Nava2
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  5. #5
    Join Date
    Feb 2006
    Location
    London, England
    Posts
    2,045
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default

    Its to do with the image

    You have to check if the image is there before calling the form up.

    Delete everything to do with the image, and it will work
    SRL Wiki | SRL Rules | SRL Stats
    Ultimate SCAR Scripting Tutorial | Starblaster100's Auth System | Join the official SRL IRC now!


    Help Keep SRL Alive! Please disable Advert Blockers on SRL! Help Keep SRL Alive!


  6. #6
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Okay, so I should call that stuff before hand? Then tell the script to load the Bitmap?

    Nava2
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  7. #7
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    FIXED ERROR:

    Made all File extensions have '\' instead of '/'. Dumb scar...

    Nava2
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Out Of Range error in my form
    By itSchRis917 in forum OSR Help
    Replies: 16
    Last Post: 09-16-2007, 09:39 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
  •