Recent

Author Topic: (Solved)Can't figure this error?(Solved)  (Read 851 times)

JLWest

  • Hero Member
  • *****
  • Posts: 1293
(Solved)Can't figure this error?(Solved)
« on: February 16, 2020, 09:29:25 am »
I have a program and I'm getting a compiler error I don't understand.

In trying to track down the error I started commenting out code, compiling and retrying.
Now I get a error with the following lines of code;
I get a error with 3 procedures.

I have included the zip of the program.

Should be able to load into one dir compile and try.

Thanks;

(Solution) Uncommitted the code  procedure and function one at a time.

It compiled and ran OK.

Thanks

Code: Pascal  [Select][+][-]
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes,  SysUtils, Forms,    Controls,
  9.   Graphics, Dialogs,  StdCtrls, FileUtil,
  10.   StrUtils;
  11.  
  12. type
  13.  
  14.   { TForm1 }
  15.   SArray = Array [1..4] of String;
  16.  
  17.  
  18.   TForm1 = class(TForm)
  19.     btnBuildOperators: TButton;
  20.     btnClose         : TButton;
  21.     btnSaveACTypes   : TButton;
  22.     btnBldFleetFiles : TButton;
  23.     btnDeleteLB8: TButton;
  24.     Edit1: TEdit;
  25.     Edit2: TEdit;
  26.     Edit3: TEdit;
  27.     Label1: TLabel;
  28.     Label11: TLabel;
  29.     Label12: TLabel;
  30.     Label14: TLabel;
  31.     Label15: TLabel;
  32.     Label16: TLabel;
  33.     Label17: TLabel;
  34.     Label18: TLabel;
  35.     Label2: TLabel;
  36.     Label3: TLabel;
  37.     Label4: TLabel;
  38.     Label5: TLabel;
  39.     Label6: TLabel;
  40.     Label7: TLabel;
  41.     Label8: TLabel;
  42.     Label9: TLabel;
  43.     ListBox1: TListBox;
  44.     ListBox2: TListBox;
  45.     ListBox3: TListBox;
  46.     ListBox4: TListBox;
  47.     ListBox5: TListBox;
  48.     LBXX: TListBox;
  49.     ListBox6: TListBox;
  50.     ListBox7: TListBox;
  51.     ListBox8: TListBox;
  52.     ListBox9: TListBox;
  53.  
  54.  
  55.   procedure FormCreate(Sender: TObject);
  56.   procedure btnCloseClick(Sender: TObject);
  57.   procedure UIMGR(AMODE : String);
  58.  
  59.  
  60.  
  61.   private
  62.  
  63.   public
  64.  
  65.   end;
  66.  
  67. Const
  68.   C_AircraftTypes = 'C:\X-Plane 11\ClassicJetSimUtils\WorldTraffic\AircraftTypes\';
  69.   C_XACTypes      = 'E:\Files\Resources\XFAAAircraftTypes.txt';
  70.  
  71.   C_Operators    = 'D:\A Current Project\Utilities\BuildFleet\Files\ICAOOper.txt';
  72.   C_ACTypesWRK   = 'E:\Files\Work\ACTypesWRK.txt';
  73.   C_FleetFiles   = 'E:\Files\FleetFiles\';
  74. var
  75.   Form1  : TForm1;
  76.   Slow   : Boolean = True;
  77.   WT3    : String = 'C:\X-Plane 11\ClassicJetSimUtils\WorldTraffic\';
  78.   LOC    : String = '';
  79.  
  80. implementation
  81.  
  82. {$R *.lfm}
  83.  
  84.  procedure TForm1.FormCreate(Sender: TObject);
  85.   begin
  86.    LOC := Application.Location;
  87.    UIMGR('1');
  88.    end;
  89.    
  90.  procedure TForm1.UIMGR(AMODE : String);
  91.   begin
  92.    Case AMODE of
  93.     '1'  : begin
  94.             Edit1.Text := '';
  95.             Edit2.Text := '';
  96.             Edit3.Text := '';
  97.             Label11.Caption := '';
  98.             Label12.Caption := '';
  99.            end;
  100.     '11' : begin
  101.             Label11.Caption := '';
  102.             Label12.Caption := '';
  103.            end;
  104.     '12' : begin
  105.             Label11.Caption := '';
  106.             Label12.Caption := '';
  107.             Label14.Caption := '';
  108.             Label15.Caption := '';
  109.             Label16.Caption := '';
  110.             Label18.Caption := '';
  111.            end;
  112.  
  113.     'C'  : ;
  114.     end;
  115.  end;                                                                        
  116.  
  117.  procedure TForm1.btnCloseClick(Sender: TObject);
  118.   begin
  119.    Close;
  120.   end;
  121.  
  122. end.
  123.                                                                                                
« Last Edit: October 23, 2020, 01:25:57 am by JLWest »
FPC 3.2.0, Lazarus IDE v2.0.4
 Windows 10 Pro 32-GB
 Intel i7 770K CPU 4.2GHz 32702MB Ram
GeForce GTX 1080 Graphics - 8 Gig
4.1 TB

440bx

  • Hero Member
  • *****
  • Posts: 4063
Re: Can't figure this error?
« Reply #1 on: February 16, 2020, 09:52:25 am »
I can compile the project you posted without any problems.

I see there is a fair amount of code that is commented out. 

Post a file the way you want it to work, that is, without any comments to sidestep the compile problem.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

JLWest

  • Hero Member
  • *****
  • Posts: 1293
Re: Can't figure this error?
« Reply #2 on: February 16, 2020, 05:32:17 pm »
I got to thinking last night.

When I commented out the code I didn't delete the Events but keep them. So there is a difference of what you compiled and I have.

It will take me a bit to post the program as it has several data files it loads. I'll try and fix something up today.

Thanks. 
FPC 3.2.0, Lazarus IDE v2.0.4
 Windows 10 Pro 32-GB
 Intel i7 770K CPU 4.2GHz 32702MB Ram
GeForce GTX 1080 Graphics - 8 Gig
4.1 TB

 

TinyPortal © 2005-2018