How to define operator in pascal

Viewed 1167

In my program I have a need to get percent often in code. For now i have this function to solve it

function percent(whole, part: double):double;
 begin
      percent:= whole * part / 100;
 end;

I was wondering is there any way I could make new operator so I can write only something like: a:=100%20, and get wanted result. It would also should be able to be used as: c:=b/a; or : c:=c/a;

3 Answers
Related