Community articleProviding help information for each of your functions
Added by IBM contributorIBM on May 6, 2011
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars




By using the function template FunctionCallHelp, you can provide help information to form designers within a development environment (for example the Designer). Use FunctionCallHelp to help form designers choose and use the correct functions.

Provide in depth help information for each of the functions you create by implementing the function FCISimpleHelp.
  • FCISimpleHelp must be implemented since the service was defined previously with the call to FunctionCall_SetObjectProc.
  • In the following example, FCISimpleHelp provides help information for the multiply function.
  • #ifndef OLD_STYLE_PARAMS
    PRE_FUNCTION_DECL r_short POST_FUNCTION_DECL FCISimpleHelp(FunctionCall 
       *theObject, 
    r_charP thePackageName, r_charP theFunctionName, r_u_long theFunctionID, 
       IFSUserData 
    **theFunctionDataPtr, r_charP *theQuickDescPtr, r_charP *theFunctionDescPtr, 
       r_charP 
    *theSampleCodePtr, r_charP **theArgsNameListPtr, r_long *theArgsNameListSizePtr, 
       r_charP 
    **theArgsDescListPtr, r_long *theArgsDescListSizePtr, r_short 
       **theArgsFlagListPtr, r_long 
    *theArgsFlagListSizePtr, r_charP *theRetValDescPtr, r_short 
       *theRetValFlagPtr)
    #else
    PRE_FUNCTION_DECL r_short POST_FUNC_DECL FCISimpleHelp(theObject, 
       thePackageName, 
    theFunctionName, theFunctionID, theFunctionDataPtr, theQuickDescPtr, 
       theFunctionDescPtr, 
    theSampleCodePtr, theArgsNameListPtr, theArgsNameListSizePtr, 
       theArgsDescListPtr, 
    theArgsDescListSizePtr, theArgsFlagListPtr, theArgsFlagListSizePtr, 
       theRetValDescPtr, theRetValFlagPtr)
    FunctionCall *theObject;
    r_charP thePackageName;
    r_charP theFunctionName;
    r_u_long theFunctionID;
    IFSUserData **theFunctionDataPtr;
    r_charP *theQuickDescPtr;
    r_charP *theFunctionDescPtr;
    r_charP *theSampleCodePtr;
    r_charP **theArgsNameListPtr;
    r_long *theArgsNameListSizePtr;
    r_charP **theArgsDescListPtr;
    r_long *theArgsDescListSizePtr;
    r_short **theArgsFlagListPtr;
    r_long *theArgsFlagListSizePtr;
    r_charP *theRetValDescPtr;
    r_short *theRetValFlagPtr;
    #endif
    {
          switch(theFunctionID)
          {
             case FCI_MULTIPLY_ID:
                if (((*theQuickDescPtr) = cp_strdup("Multiplies two numbers
                   together")) == NULL)
                {
                   MessageBox(NULL, "Out of memory", "Error", MB_OK);
                   return(NOTOK);
                }
                if (((*theFunctionDescPtr) = cp_strdup(
                   "This function multiplies two numbers together."
                   "/n It takes the values of two fields"
                   "/n and finds their product with a precision"
                   "/n of up to seven decimal places.")) == NULL)
                {
                   MessageBox(NULL, "Out of memory", "Error", MB_OK);
                   return(NOTOK);
                }
                if (((*theSampleCodePtr) = cp_strdup(
                   "\t<field sid=\"PRODUCT_FIELD\">\n"
                   "\t\t<value compute=\"test_Package.multiply" 
                   "(field1.value, field2.value)\"></value>\n"
                   "\t\t<size>\n"
                   "\t\t\t<ae>10</ae>\n"
                   "\t\t\t<ae>1</ae>\n"
                   "\t\t</size>\n"
                   "\t</field>\n")) == NULL)
                {
                   MessageBox(NULL, "Out of memory", "Error", MB_OK);
                   return(NOTOK);
                }
                if (((*theRetValDescPtr) = cp_strdup(
                   "The product of the two parameters given")) == NULL)
                {
                   MessageBox(NULL, "Out of memory", "Error", MB_OK);
                   return(NOTOK);
                }
                break;
             default:
                break;
          }
          return(OK);
    }

Parent topic: Setting up the Extension Initialization function