Recent

Author Topic: passing a procedure as argument  (Read 2104 times)

Nebulix

  • Newbie
  • Posts: 4
passing a procedure as argument
« on: May 26, 2015, 01:39:48 pm »
I imported a program from Turbo Pascal in which there is a call to a procedure with an other procedure as argument
procedure1 ( procedure2, other arguments);
and I get an error message at compilation :
 wrong number of parameters specified for call to procedure2.
Is there a way of fixing that ?

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: passing a procedure as argument
« Reply #1 on: May 26, 2015, 01:49:55 pm »
In fpc you may need a pointer of procedure, so @procedure. Otherwise you could show more/full code for us to get a better idea of the problem. How did you declare procedure1, procedure2 and the pointer type?

Nebulix

  • Newbie
  • Posts: 4
Re: passing a procedure as argument
« Reply #2 on: May 26, 2015, 02:27:23 pm »
Sorry, this was a beginners mistake. I just Went to Options/Compiler and checked Turbo Pascal compatible and got ...an other error, I will ask about in a new post

 

TinyPortal © 2005-2018