Please enable JavaScript to view this site.

 

Navigation: Macros > Macro Language > Compiler Messages > Hints

Function is defined but never used

Scroll Prev Up Next More

This compiler hint will occur if one of the user-defined functions at the top of your macro is never used in the macro's main body.

 

For example, you might originally have added a function to a macro to get the name of the current Zodiac sign as in the example below.

function ZodiacNameOfDate(nSomeDate): s
var
   nIndex sBuffer
begin
   nIndex = MoonZodiacSignOf(nSomeDate,0,true,1)
   sBuffer = ZodiacName(nIndex)
   return sBuffer
end
 
var
   nCurIndex
begin
   // the call to the user function ZodiacNameOfDate
   // was replaced by calls to the built-in functions
   // and the user-defuined functio is no longer needed
   nCurIndex = ZodiacSignOf(n_TokenDate, 1, true)
   sResult = ZodiacName(nZodiacIndex)
end

But, then, later, you found out that there were built-in macro functions that could do the same thing and you decided to use them instead of your own function, which is no longer used/needed, as this hint informs you of.

 


Topic 181005, last updated on 18-Apr-2020