RapidXLL Team
Simple.hpp       Simple_B.hpp       Simple_C.hpp


// 
// Copyright(c) BreezeWay Software Corporation.  
// All rights reserved.
//
//                  Simple_B.hpp
//
//       Simple_B.hpp contains examples of :
//              Category, CallPrefix, 
//              Exporting a class, RapidIDCtor, Rapid 
//              Volatile, Hidden Functions
//
//
//  FEATURE                          MEANING
//  ------------------------         -------------------------------------------
//
//  Category = NS                    This function should reside in it's own 
//                                   Excel category/name space
//
//  CallPrefix = Prefix              This function must be called with this 
//                                   prefix.  As in:     Prefix.F(x)
//
//  Volatile                         Calculated whenever anything is computed.
//
//  Hidden                           Hidden from function wizard menu.
//

#include <RapidXLL.hpp>      // API  ( REQUIRED )
using namespace RapidXLL;    // Makes coding simpler 

namespace SimpleNS
{

  //--------------------------------------------

  /* RXLL
   * Help = Function n a different category (RXLL.Misc) with a prefix of Misc. 
   * Help = Parameter help information is acquired from prototype itself.

   * Category = RXLL.Misc
   * CallPrefix = Misc
   */
  RAPID_EXPORT
  RapidRange TrimStrings(const RapidRange& strs  /* strings to convert */, 
			 const long  maxLen = 10 /* num of times to repeat */);


  //--------------------------------------------
  //--------------------------------------------

  //****************************************************************************
  //   
  // * Classes and structs can be used in Excel through public static functions
  //   NOTE:  RAPID_EXPORT is used before the class name  
  //   
  // * Factory functions use 
  //          RapidIdCtor 
  //    to build a string handle.  The user can specify a meaningful label 
  //    and RapidXLL ensures uniqueness.
  //   
  // *  Member functions then use 
  //          RapidId
  //    when using the handle.
  //   
  //****************************************************************************

  class RAPID_EXPORT Vector {
  public:
    /* RXLL
     * Help = This function builds a named vector object.  The RapidIdCtor 
     * Help : type builds a unique ID for this object. 
     * Category = RXLL.IDs
     */
	  static void Factory(const RapidIdCtor& vecName, 
                              const RapidRange& values);
        
    //--------------------------------------------
    
    //* RXLL :  The RapidId type is used to find the appropriate VectorCTOR.  
    //* Help :  Returns sum of numeric fields.
    //* Category = RXLL.IDs
    //* Help vecId = ID returned by VectorCTOR. This is the handle.
    static double Sum(const RapidId& vecId);

    //--------------------------------------------

    /* RXLL
     * Help = The RapidId type is used to find the appropriate VectorCTOR.  
     * Help = Returns two rows x columns in two cells.
     * Category = RXLL.IDs
     * Help vecId = ID returned by VectorCTOR. This is the handle.
     */
    static RapidRange Dims(const RapidId& vecId);
    
    //--------------------------------------------
    
    // //*   RXLL: Function cannot be exported to Excel because it is non-static
    // //    NOTE: Try removing the first '// '
    double PublicNon_StaticFunction(const RapidId& vecId) { return 0; };

  protected:

    /*!!  RXLL:
     *  Help: Function cannot be exported to Excel because it is not public
     *  Help: Try removing the !!
     */
    static double NonPublic_StaticFunction(const RapidId& vecId) { return 0; };

  }; // end of class Vector
    

  //--------------------------------------------

  /* RXLL
   * Help: Volatile functions are called EVERY time anything is computed.  
   * Help: Returns count of times it has been called. 
   * Volatile
   */
  RAPID_EXPORT
  int   VolatileFunction();

  //--------------------------------------------

  /* RXLL
   * Help : NOTE:  Hidden functions are NOT seen in Func Wizard.  
   * Help :              This one is also Volatile.
   * Help :              Returns count of times it has been called.
   * Hidden, Volatile
   */
  RAPID_EXPORT
  double HiddenVolatileFunction();

} // end of NS namespace

  //--------------------------------------------

/* RXLL
 * Help = This counter comes from the GLOBAL namespace  ::GlobalCounter()
 * Category = RXLL.Misc
 * CallPrefix = Misc
 * Volatile
 */
RAPID_EXPORT
double GlobalCounter() { static int i = 0; return ++i; };


Home    Products    Contact Us    Download    Buy Now