Forum > General

FPC 3.2.2 - AnAddr: CodePointer - How to use for Function call ?

(1/2) > >>

paule32:
Hello,

how the Subject says: How to use CodePointer for calling a Pascal Function ?
Thanks for reading, and helping

paule32

Fibonacci:
Like this?


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure test;begin  writeln('test proc');end; var  p: codepointer;  t: procedure; begin  // lets say you have a pointer  p := @test;   // and you want to call it  // assign pointer to "t"  pointer(t) := p;  // and call it  t;end.

paule32:
thanks fibo !
I am out of hospital, and have more time for our project.
How about you ?
I hope a good mood.

Fibonacci:
Glad you are ok :) Im fine too, thanks

Ten_Mile_Hike:

--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Hello Guys,Could you help me to understand when any whyButton1Click would be preferred over the Button2Clickprocedures below. Thanks,DBM 


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Procedure test;begin  Form1.button1.caption:='test proc';end; procedure TForm1.Button1Click(Sender:TObject);var  p: codepointer;  t: procedure;begin  p := @test;  pointer(t) := p;  t;end; procedure TForm1.Button2Click(Sender:TObject);begin  Test;end;

Navigation

[0] Message Index

[#] Next page

Go to full version