Sistema Fenix Posted April 3, 2014 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 Quote
asapltda Posted April 3, 2014 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; Quote
Sherzod Posted June 25, 2014 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. Quote
Administrators Farshad Mohajeri Posted June 25, 2014 Administrators Posted June 25, 2014 Example for? Quote
Sherzod Posted June 27, 2014 Posted June 27, 2014 Example for? Hi Farshad! Creation of user-defined (arbitrary) function with callback... Thank you. Quote
Administrators Farshad Mohajeri Posted June 27, 2014 Administrators Posted June 27, 2014 Still do not understand. We already have Form.Show with callback implemented. Quote
Jancarlos Martins Posted June 27, 2014 Posted June 27, 2014 Hi, Look Demos FormCallback, LoginForm Quote
Sherzod Posted June 28, 2014 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.