Timothy Groves schrieb:
Can anyone think of a situation in which you would *have* to use forward declared functions? I'm trying to come up with an example for such for my book, and I am drawing a blank.


Well, maybe this one:

-------------------------------------------------------------------
type SorterProcType = function (String1,String2 : shortstring) : boolean;
function CompareIt1(String1,String2 : shortstring) : boolean; forward;
function CompareIt2(String1,String2 : shortstring) : boolean; forward;
function CompareIt3(String1,String2 : shortstring) : boolean; forward;
const SortCriteria : SortProcType = CompareIt1;

-------------------------------------------------------------------

I don't know of another way that you can use one of the "CompareIt1/2/3" functions in the const declaration for "SortCriteria" (but maybe there is one).
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to