Recent

Author Topic: [SOLVED] Abort; question  (Read 3149 times)

k1attila1

  • Full Member
  • ***
  • Posts: 108
[SOLVED] Abort; question
« on: February 13, 2017, 07:18:15 pm »
Hello

this :

procedure TForm1.FormCreate(Sender: TObject);
begin
    abort;
end;

why doesn't abort the creation of form ? (If i remember well delphi abort it.)

 
thnak you Attila

« Last Edit: February 14, 2017, 06:07:02 am by k1attila1 »

ASerge

  • Hero Member
  • *****
  • Posts: 2434
Re: Abort; question
« Reply #1 on: February 13, 2017, 07:44:19 pm »
why doesn't abort the creation of form ? (If i remember well delphi abort it.)
Only in older versions of Delphi. In later version event OnCreate called from the method DoCreate (from the AfterConstruction). And controls this behavior by the field OldCreateOrder.
Lazarus uses only new approach.

Thaddy

  • Hero Member
  • *****
  • Posts: 17379
  • Ceterum censeo Trump esse delendam
Re: Abort; question
« Reply #2 on: February 13, 2017, 08:54:48 pm »
Why do you want to use abort?, just curious.

In general that is not necessary and mostly not a brilliant idea, since it raises a silent exception.
It can bring you into a lot of trouble later on in your program.

Although it is valid Pascal, there are most likely other, better, options that avoid it.
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

k1attila1

  • Full Member
  • ***
  • Posts: 108
[SOLVED] Abort; question
« Reply #3 on: February 14, 2017, 06:06:13 am »
Thnak you both of you
I just play with Lazarus sometimes and try something special.
Attila

 

TinyPortal © 2005-2018