Validating user's input before creating graph using TChart
Besides deciding if a coefficient is valid or not the function CheckCoefficientBoxesValidInput can also say what is wrong and suggest how the user can fix it.

In order to communicate such information up to the caller and up to the user interface you can use throwing an exception.

Main success scenario would mean no ifs, just sequence of statements.

Exceptional flow would be encoded in try/except blocks, either in this function or somewhere upwards or in the final Application.OnException handler.

Whether the code would be easier to maintain or not is only opinion-based matter of taste and your established coding conventions.

The main improvement would be that the end-user would know what happened and what to do next.

See also:


normative MSDN: Windows → Dev Center - Desktop → Design → Guidelines → Error Messages
informative MSDN: Documentation → Framework Design Guidelines → Design Guidelines for Exceptions