How to access delphi function at DPR scope -
I have a problem with maintenance on the old Delphi program (D7). A lot of program logic is in the DPR file (it is not a window program), providing things like database access to some units. We need to get some debug from the DB unit, but debug functionality is in DPR. We can not easily strip the functionality of the debug, because it uses those items which are unique to the DPR, like its main pipe. It would be like trying to tease spaghetti and meatball sauce.
So how do we call a function which has been declared by a subordinate unit in the DPR area? What is the equivalent of :: operator in C ++?
Please do not tell me to redesign the app. I would love it, but we will not be given the required time. Plus if we design this puppy, then it will not be in Delphi.
You can declare a method variable in the program that matches the signature of the function in the DPR In the beginning you set the method variable in the function. Inside the unit, you call the method variable.
Example:
(DPR)
Uses Unit 1; DoSomething function (cross: integer): integer; Start ... end; ... Start DoSomethingVar: = DoSomething; ... End;
(entity)
unit unit 1; Interface ... var DoSomethingVar: function (paragraph 1: integer): integer; ... Implementation ... Some Result: = DoSomethingVar (SomeParameter); ...
Comments
Post a Comment