Bug I Think in the IDE or Compiler? lazarus / 61-Beginners ---------------------------------------------------------------------- JLWest · 2020-05-14 03:00 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit Unit1; {$mode objfpc}{$H+} interface uses   Buttons, Classes, Clipbrd, Controls, Crt, DateUtils, Dialogs,   ExtCtrls, Forms, fphttpclient, fpjson, Graphics, jsonparser,   opensslsockets, StdCtrls, StrUtils, SysUtils, FileUtil, Unit2, SpinEx; type   CiriumTypes = (AFLITID, AOPER, ADEP, ADTIME, AARR, AATIME, AACRAFT, AFNO, ANNBR,  XNIL );  RType       = (AIATA, AICAO, FltData, TZone, FltNbr, Departure, Arrival, Airline, Flight, Aircraft, Codeshared, ATimeS, ATIMEE, NNBR, ANIL, xSTOP, live);  ASDGltType  = (CARRIER, CALLSIGN, IATACODE, ICAOCODE, ALTNIL);   { TForm1 }   TForm1 = class(TForm)        procedure FormCreate(Sender: TObject);   private   function RESTCall(ACALL      : string;                     SaveToFile : boolean = false;                     Filename   : string='' ): string;  public   end; Const CNiL = 'Nil'; C_Debug = 'Debug\Debug.txt'; var  Form1     : TForm1;  GKEY      : String = 'Nil';  GPGMID    : String = 'Nil';  GFILENAME : sTRING = '';  GRETURN   : AnsiString = '';  LOC     : String = '';  VPATH     : Boolean = False;  VKEY      : Boolean = False;  GMSTCARRSW: Boolean = False;  VRCD      : VType;  S1        : String = '';  P_WT3     : String = '';   Slow      : Boolean = True;  RCDIDX    : RCDINDEX;  BlkSize   : Integer = 10;  ASize     : Integer = -1;   TODAY     : TDateTime;  ThisYear  : Word;  ThisMonth : Word;  ThisDay   : Word;   DateString: String;  Final     : Boolean = False;  DebugON   : Boolean = True;  TestMode  : Boolean = True;implementation {$R *.lfm} { TForm1 } procedure TForm1.FormCreate(Sender: TObject); Var  FName     : String = '';  P,S,Ser,C : String;  Suffix    : String = '.txt'; begin  TODAY := Date;  DateString := DateTimeToStr(TODAY,TRUE);  DecodeDate(Today,ThisYear,ThisMonth,Thisday);  LOC := Application.Location;  DirAndFileWork;  if DebugOn then begin    btnDebugOn.Caption := 'Debug On';    btnDebugOn.Visible := True;    btnDebugOn.Enabled := True;  end;  if Final then begin    BitAPIFromFile.Visible := False;    btnKeySelect.Visible := False;    btnDebugOn.Visible := False;  end;   UIMGR('PROV');   VRCD.VProvider := 'AviationStack';   VRCD.VServices := 'Flights';   P := GetProvider(S);   Ser := Serialize;   C := '00000';   GFILENAME := S + C + Ser + Suffix;   Edit17.Text := S;   Label3.Caption := VRCD.VProvider;   LoadAListbox(1,Listbox4);                      {Loading Dir Displays}   LoadAListbox(2,Listbox2);                    {Loading Dir Displays}   VPath := ValidatePath;   LBKeyClick(Nil);   UIMGR('A');  end; procedure TForm1.rbFlightsByDateClick(Sender: TObject);begin end;   Procedure TForm1.AssignNameAndSaveFile(ABOX : Tlistbox);  Var  S  : String = 'FILE';   AName  : String = 'Nil';   LocDir : String = '';   SubDir : String = '';   FName  : String = '';   Suffix : String = '.txt';   Ser    : String = '';  begin   AName := GetFileName;   LocDir := LOC;   Case VRCD.VServices of    'Flights'    : SubDir := 'FlightFiles\';    'Airlines'   : SubDir := 'Airlines\';   end;   S := LocDir +  SubDir +  VRCD.VPROVIDER + '\' +  AName + Suffix;   LBoxToFile(S, ABOX); end;  Procedure TForm1.RouterSettings;  Var i : Integer = -1;    Valid   : Boolean = False;    iDate   : TDateTime;    ADate   : AnsiString = '';  begin   VRCD.Complete := True;;   VRCD.VLimit := IntToStr(seLimit.Value);     { VRCD          Valid Value      }   VRCD.VMax := cbMax.Checked;                 {VRCD;VLimit    1 - 1000         }   if rbServicesFlights.Checked = True then      {VRCD.Max       On/Off         }   VRCD.VServices := 'Flights'                   {VRCD.Service Flights Airlines }   else VRCD.VServices := 'Airlines';            {VRCD.VServMode Text\ LIVE\      }                                               {VRCD.Date       2019-02-31      }    ADate := Edit18.Text + '-' + Edit20.Text + '-' + Edit19.Text;   Valid := TryStrToDate(ADate,iDate,'-');   if Valid then begin VRCD.VDate := ADate   end else begin    ShowMessage('Enter valid date YYYY-MM-DD');   end;  end;  procedure TForm1.btnquitClick(Sender: TObject); begin  end;  procedure TForm1.UniversalSave(AMODE: String; AFILENAME: String;   AITEM: String; BOX: TListbox); begin  end;  procedure TForm1.WriteToFile(const AFile: String; const ALINE: String); begin  end;  procedure TForm1.LBoxToFile(AFile: String; ABOX: TListbox); begin  end;  procedure TForm1.ListBoxToFileASD(AFile: String; ABOX: TLISTBOX); begin  end;  procedure TForm1.DirListToListbox(AFILENAME: String; ABOX: TListbox); begin  end;  procedure TForm1.LoadAListbox(AMODE: Integer; ABOX: TListbox); begin  end;  procedure TForm1.LoadListBoxFromFile(AListBox: TListBox;   const AFileName: String); begin  end;  procedure TForm1.LoadListbox2; begin  end;  procedure TForm1.SplitCarrierFile; begin  end;  procedure TForm1.SplitIATAICAO(ABOX: TListbox; ICAOBox: TListbox;   IATABox: Tlistbox); begin  end;  procedure TForm1.LoadCarrierNameICAOAndIATA; begin  end;  procedure TForm1.TestDataFromFile; begin  end;  function TForm1.LoadATextFile(const APATH: String): String; begin  end;  function TForm1.LoadAAPIFromFile: String; begin  end;  procedure TForm1.CopyFiles; begin  end;  procedure TForm1.ChopString(TIMES: Integer; ACHAR: Char); begin  end;  procedure TForm1.ClearRCD; begin  end;  procedure TForm1.CreateRaw; begin  end;  procedure TForm1.DirAndFileWork; begin  end;  procedure TForm1.MakeTheDirectorys; begin  end;  procedure TForm1.PartialClearRCD; begin  end;  procedure TForm1.ToTop(ABOX: TListBox); begin  end;  procedure TForm1.TimeSet(AITEM: String); begin  end;  procedure TForm1.UIMGR(AMODE: String); begin  end;  procedure TForm1.ProcessCarriers; begin  end;  procedure TForm1.BuildANewMasterCarrier; begin  end;  procedure TForm1.SetUpGRETURN; begin  end;  function TForm1.GetCallsMadeDirName: String; begin  end;  function TForm1.GetFlightFileName(out ASER: String; out ASuffix: String   ): String; begin  end;  function TForm1.GetFliteSaveDirName: String; begin  end;  function TForm1.GetItem(AInteger: Integer; AITEM: String): String; begin  end;  function TForm1.GetProvider(out FPFX: String): String; begin  end;  function TForm1.GetRelativePosition: Integer; begin  end;  function TForm1.GetICAOOper(AItem: String): String; begin  end;  function TForm1.GetGLOBALFlightFileName: String; begin  end;  function TForm1.GetFileName: String; begin  end;  function TForm1.ICAOToIATALookup(AITEM: String; out A: String): Boolean; begin  end;  function TForm1.IATALookup(AITEM: String; out A: String): Boolean; begin  end;  function TForm1.Serialize: String; begin  end;  function TForm1.TrimItem(ANBR: Integer; AIND: Char; AITEM: String): String; begin  end;  function TForm1.ValidateLine(ALINE: String): Boolean; begin  end;  function TForm1.UT_StrToDate(str: string): TDateTime; begin  end;  function TForm1.WeekDay(Offset: Integer; ATIME: TDateTime): String; begin  end;  function TForm1.ATimeToString(ATIME: TDateTime): string; begin  end;  function TForm1.STDT(ADT: String): TDateTime; begin  end;  function TForm1.ConvertToZULU(AITEM: String): String; begin  end;  procedure TForm1.btnCallClick(Sender: TObject); begin  end;  procedure TForm1.btnCarrierClick(Sender: TObject); begin  end;  procedure TForm1.btnSetPathClick(Sender: TObject); begin  end;  procedure TForm1.btnSetKeyClick(Sender: TObject); begin  end;  procedure TForm1.btnKeySelectClick(Sender: TObject); begin  end;  procedure TForm1.btnDebugOnClick(Sender: TObject); begin  end;  procedure TForm1.btnDeleteCallsClick(Sender: TObject); begin  end;  procedure TForm1.btnDeleteFilesClick(Sender: TObject); begin  end;  procedure TForm1.BitAPIFromFileClick(Sender: TObject); begin  end;  procedure TForm1.btnSaveRouterClick(Sender: TObject); begin  end;  procedure TForm1.btnTestClick(Sender: TObject); begin  end;  procedure TForm1.Edit4Exit(Sender: TObject); begin  end;  procedure TForm1.Edit4Enter(Sender: TObject); begin  end;  procedure TForm1.Edit5Exit(Sender: TObject); begin  end;  procedure TForm1.Edit5Enter(Sender: TObject); begin  end;  procedure TForm1.Edit17Enter(Sender: TObject); begin  end;  procedure TForm1.Edit17Exit(Sender: TObject); begin  end;  procedure TForm1.Edit21Enter(Sender: TObject); begin  end;  procedure TForm1.Edit21Exit(Sender: TObject); begin  end;  procedure TForm1.Edit22Enter(Sender: TObject); begin  end;  procedure TForm1.Edit22Exit(Sender: TObject); begin  end;  procedure TForm1.ListBox1Click(Sender: TObject); begin  end;  procedure TForm1.ListBox2Click(Sender: TObject); begin  end;  procedure TForm1.ListBox3Click(Sender: TObject); begin  end;  procedure TForm1.ListBox4Click(Sender: TObject); begin  end;  procedure TForm1.ListBox8AClick(Sender: TObject); begin  end;  procedure TForm1.ListBox8Click(Sender: TObject); begin  end;  procedure TForm1.ListBox9Click(Sender: TObject); begin  end;  procedure TForm1.ListBox10Click(Sender: TObject); begin  end;  procedure TForm1.ListBox11Click(Sender: TObject); begin  end;  procedure TForm1.ListBox13Click(Sender: TObject); begin  end;  procedure TForm1.LBKeyClick(Sender: TObject); begin  end;  procedure TForm1.rbAviiationEdgeClick(Sender: TObject); begin  end;  procedure TForm1.rbArrivingClick(Sender: TObject); begin  end;  procedure TForm1.rbAviationStackClick(Sender: TObject); begin  end;  procedure TForm1.rbCIRIUMClick(Sender: TObject); begin  end;  procedure TForm1.rbCthttpClick(Sender: TObject); begin  end;  procedure TForm1.rbCthttpsClick(Sender: TObject); begin  end;  procedure TForm1.rbCtRESTClick(Sender: TObject); begin  end;  procedure TForm1.rbDepartingClick(Sender: TObject); begin  end;  procedure TForm1.rbFlightTrader24Click(Sender: TObject); begin  end;  procedure TForm1.rbOAGClick(Sender: TObject); begin  end;  procedure TForm1.rbjsonClick(Sender: TObject); begin  end;  procedure TForm1.rbSvsAirlinesClick(Sender: TObject); begin  end;  procedure TForm1.rbServicesFlightsClick(Sender: TObject); begin  end;  procedure TForm1.rbXMLClick(Sender: TObject); begin  end;  procedure TForm1.cbMaxExit(Sender: TObject); begin  end;  procedure TForm1.cbUTFADJExit(Sender: TObject); begin  end;  procedure TForm1.ValidateKey(APROVIDER: String); begin  end;  procedure TForm1.ValidatePGMID(APROVIDER: String); begin  end;  function TForm1.ValidatePath: Boolean; begin  end;  procedure TForm1.AviationStackFlightsCall; begin  end;  procedure TForm1.ThreeStageASDFlightParser; begin  end;  procedure TForm1.GenericParserOfGRETURN(ABOX: TListbox); begin  end;  procedure TForm1.Stage3ASDFliteParseRecords; begin  end;  procedure TForm1.FileASDFliteFlight; begin  end;  function TForm1.GetASDFlightType(ALine: String): RType; begin  end;  procedure TForm1.AviationStackAirlineCall; begin  end;  procedure TForm1.AddCarrier(ACarrier: String; AICAO: String; AIATA: String); begin  end;  procedure TForm1.BuildCarrierFile; begin  end;  procedure TForm1.BuildCarrierFileLB3; begin  end;  procedure TForm1.CarrierFile; begin  end;  procedure TForm1.CarrierNameUpdate(AIDX: Integer; AICAO: String;   ACarrier: String); begin  end;  procedure TForm1.IATACodeUpdate(AIDX: Integer; AICAO: String; AIATA: String); begin  end;  procedure TForm1.Stage3ASDAirlineParseRecords; begin  end;  procedure TForm1.ThreeStageASDAirlineParser; begin  end;  procedure TForm1.UpdateCarrierRecord(AIDX: Integer; ACarrier: String;   AICAO: String; AIATA: String); begin  end;  function TForm1.GetASDAirlineType(ALine: String): ASDGltType; begin  end;  procedure TForm1.CallCIRIUM; begin  end;  procedure TForm1.CIRIUMParser; begin  end;  procedure TForm1.PrepCIRIUMString; begin  end;  procedure TForm1.Stage2CIRIUM; begin  end;  procedure TForm1.Stage3CIRIUM; begin  end;  procedure TForm1.BuildACiRIUMRCD(ALINE: String); begin  end;  procedure TForm1.FltDate(AITEM: String); begin  end;  procedure TForm1.CShare(AITEM: String); begin  end;  procedure TForm1.DepAirportName(AIDX: Integer; AITEM: String); begin  end;  procedure TForm1.AirlineName(AITEM: String); begin  end;  procedure TForm1.ArrAptName(AIDX: Integer; AITEM: String); begin  end;  procedure TForm1.FltNo(AITEM: String); begin  end;  procedure TForm1.AircraftType(AITEM: String); begin  end;  procedure TForm1.CallCIRSettings; begin  end;  function TForm1.GetCIRIUMType(ASTRING: String): CiriumTypes; begin  end;  function TForm1.ResolveICAOIATA(ATXT: String; AService: String): String; begin  end;  function TForm1.ConvertIATAToICAO(AFLTID: String; AOperIATA: String;   ADEPIATA: String; AARRIATA: String; AAIRType: String; ADEPTime: String;   AFLTNBR: String; ANNUMBER: String; AARRTime: String; AVDay: String): String; begin  end;  function TForm1.GetFileName : String;  Var   S : String = 'Nil';   Insert : String = 'TEST';   AName  : String = 'Nil';   ATime  : TDateTime;   Bit1, Bit2, Bit3, Bit4   : String;   AHour,AMinute, ASecond, AMilSec : Word;   begin    ATime := Time;    DecodeTime(ATime, AHour,AMinute, ASecond, AMilSec);    Bit1 := IntToStr(AHour); Bit2 := IntToStr(AMinute);    Bit3 := IntToStr(ASecond);  Bit4 := IntToStr(AMilSec);    if TestMode then begin      Insert := 'TEST';    end else     Insert := Bit1 + Bit1 + Bit3 + Bit4;    AName :=VRCD.VServices + Insert;    S := AName;    Result := S; end;  {WIP -    C A R R I E R S} procedure TForm1.CarrierFile;  Var Path : String = '';  begin   if Listbox3.Items.Count = 0 then begin exit; end;   ProcessCarriers;   Listbox1.Clear;   Listbox3.Clear;   if GMSTCARRSW then begin      ListBoxX.Clear;      BuildCarrierFile;      BuildCarrierFileLB3;      ListboxX.Clear;      Path := LOC + 'Files\XICAOIATAIRLINES.txt';      LBoxToFile(Path, Listbox3);      Listbox3.Clear;      Listbox14.Clear;      Listbox8.Clear;      Listbox8a.Clear;      LoadCarrierNameICAOAndIATA;       GMSTCARRSW := False;   end;  end;  end.  I Can't post the full program but when I compiled the program it created all of those empty procedures matching actual procedures between lines 157 and line 816. ---------------------------------------------------------------------- jamie · 2020-05-14 11:23 Go to accelerator keys setup for the ide and remove or change the define creating all the event method blocks. It's possible by using the keyboard to run or compile its triggering the auto fill . ---------------------------------------------------------------------- JLWest · 2020-05-14 16:41 @Jamie I don't understand that. I assume t's in tools options but I don't see it. At any rate I don't think the Ide should be creating all those empty procedures.. ---------------------------------------------------------------------- Bart · 2020-05-14 20:24 If you have them declared in your class and then hit Shift+Ctrl+C to complete one such method, it will make skeletons for all ones that did not have an implementations yet. There is also some bug where, if you already made the implementations, but you have a syntax error in the code above it and press Ctrl+Shift+C, then a second set of empty methods is created. Bart ---------------------------------------------------------------------- JLWest · 2020-05-15 00:30 @Bart Hi Bart, Thanks for that. I tried using "Ctrl+Shift+C" when I first started out with Free Pascal and it gave me some problems. I can't be sure but I think it was creating empty procedures. So I stopped using it and have never retried it. But it still seems to me there is a bug somewhere. ---------------------------------------------------------------------- trev · 2020-05-15 05:03 Quote from: JLWest on May 15, 2020, 02:30:55 amBut it still seems to me there is a bug somewhere. The problem is finding a way to reliably reproduce the unwanted behaviour. Until then, noone can fix it. I've had the issue happen to me once in 18 months. ---------------------------------------------------------------------- JLWest · 2020-05-15 06:42 Yea, I agree. It happened to me a month or so ago. It did it three compiles in a row sow I wrote a strep by step and saved off the whole environment. Posted it here and no one replied to the posting. Should have just posted it as a bug. However I wanted someone to look at it first. Thanks trev