Sistema Fenix Posted April 3, 2014 Share Posted April 3, 2014 Hello Guys! Please give me an example of how Farshad, creates the function will return with callback. I tried several ways and can not do as he does, passing the procedure within the call. I need to ride some, but only managed to procedures outside the call, I would call could equal the example below: UniForm1.Show ( procedure (Result: Integer) begin UniMemo1.Lines.Add ('Form Close:' + IntToStr (Result)); end ); 1 Link to comment Share on other sites More sharing options...
asapltda Posted April 3, 2014 Share Posted April 3, 2014 *** MAIN FORM CALL LOGIN FORM , LOGIN FORM RETURN OK or false procedure TFLOGISTICASOFT.BTN_CONTINUARClick(Sender: TObject); var w_html:string; begin w_html:= '<p><strong>Usuario Invalido</strong> </p>' ; w_html:= '<p><font face="arial" color="FF0000" size="4"> Usuario Invalido </p>' ; MSGERROR.Text:='' ; FLOGIN.SHOWMODAL( procedure(Result: Integer) begin if Result = mrOk then begin FMENU.SHOWMODAL( procedure(result:integer) begin end ) end; if Result = mrcancel then MSGERROR.Text:= w_html; //MSGERROR.Text:= 'mrCancel'; end ) end; // *** LOGIN FORM BUTON LOGIN procedure TFLOGIN.UniButton1Click(Sender: TObject); begin if uppercase(CodigoImagen.Text) <> G_CAPTCHA then begin MSGERROR.Caption := 'Codigo Imagen Invalido'; CodigoImagen.SetFocus; exit; end; if d.GET_USUARIO(usuario.Text , PASSW.text) = false then begin MSGERROR.Caption := 'Usuario Invalido'; USUARIO.SetFocus; exit; end; ModalResult := mrOk ; end; ******** // *** LOGIN FORM BUTON CANCEL procedure TFLOGIN.UniButton_CANCELARClick(Sender: TObject); begin ModalResult := mrCancel ; end; Link to comment Share on other sites More sharing options...
Sherzod Posted June 25, 2014 Share Posted June 25, 2014 Please give me an example of how Farshad, creates the function will return with callback. +1 Hi Farshad! Can you answer us? Can you give an example? Sincerely. Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted June 25, 2014 Administrators Share Posted June 25, 2014 Example for? Link to comment Share on other sites More sharing options...
Sherzod Posted June 27, 2014 Share Posted June 27, 2014 Example for? Hi Farshad! Creation of user-defined (arbitrary) function with callback... Thank you. Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted June 27, 2014 Administrators Share Posted June 27, 2014 Still do not understand. We already have Form.Show with callback implemented. Link to comment Share on other sites More sharing options...
Jancarlos Martins Posted June 27, 2014 Share Posted June 27, 2014 Hi, Look Demos FormCallback, LoginForm Link to comment Share on other sites More sharing options...
Sherzod Posted June 28, 2014 Share Posted June 28, 2014 Hi Farshad. Hi perjanbr. Thank you for your answers! Sorry, but I understood the question Fenix otherwise ... , ie how to create a custom user-defined function with callback? Is it possible? for example: after the completion of a certain function, the function calls another callback function. Sorry if I was not able to to explain the essence of my question, and if the question is not correct... Sincerely. Link to comment Share on other sites More sharing options...
zilav Posted June 28, 2014 Share Posted June 28, 2014 No Callback Hell in Delphi please Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now