User Tools

Site Tools


derived_prevent_function_overloading_.htm
Navigation:  Language Reference > 2 - Program Source Code Format > Prototype Attributes >====== DERIVED (prevent function overloading) ====== Previous pageReturn to chapter overviewNext page

DERIVED

blk2blue.jpg

The DERIVED attribute of a PROCEDURE prototype specifies that the PROCEDURE on whose prototype it is placed is a VIRTUAL procedure. It can be used by itself or in addition to the VIRTUAL attribute on the prototype.

Use DERIVED to force a compile error when non-matching prototypes between a DERIVED virtual method and its PARENT are found. This prevents function overloading when a VIRTUAL method is the intention.

Example:

ClassA CLASS

Method1 PROCEDURE(LONG, <;LONG>),VIRTUAL

      END

ClassB CLASS(ClassA)

Method1 PROCEDURE(LONG,<;LONG>),DERIVED

      END

ClassC CLASS(ClassA)

Method1 PROCEDURE(LONG,<;LONG>),VIRTUAL,DERIVED

      END

ClassD CLASS(ClassA)

Method1 PROCEDURE(STRING),DERIVED  !Will produce compiler error:

      END                         !must match parent prototype

See Also:

CLASS

VIRTUAL

derived_prevent_function_overloading_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1