JCL Help:MakePercentage

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Hehe, no way...


Pascal

 function MakePercentage(const Step: Longint; const Max: Longint): Longint;


Parameters

Parameters Description
const Step: Longint Sorry, no can do.
const Max: Longint No idea, but I do know that passing 0 will trigger an assertion if you have assertions enabled or a runtime error (EDivByZero) if not.


Return Value

All I have to say about this is that it is very well possible that the result may be larger than 100 and that the sign of the arguments is preserved so it is possible that the result is negative.


Description

I dare not describe this function's purpose. See the Notes section below. As a tribute to that wonderful article this function has been designated the alias HowAOneLinerCanBiteYou. You are encouraged to use that alias in your applications as opposed to the much more readable and self-explanatory name MakePercentage :-)


About

Unit

JclUnitConv


Donator

Marcel van Brakel


Notes

For a very educational dissection of this function have a look at the article written by Robert Marquardt entitled " Lessons in good programming or how a one liner can bite you" available at the Voyager section on the JEDI website.


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page