XLRangesToMemory





http://www.QuantTools.com
CapeTools QueryDB function list

Welcome | Documentation format | QuantTools Groups | QuantTools Categories | Licence

Key TAGs | Excel Index | API Index



Stores a series of XL ranges to memory under a single handle.

You can retrieve items by using the query function QueryRangeDB(), and providing the name of the parameter used within this function.

Thus if you stored a range under the parameter named Range4, Range4 is what you will use within the QueryRangeDB() function.



This function creates an object and returns a string-key value to represent this created object.
The TAG value of the string-key returned (second part of the key) is : "CUSTOM"



Note: Within Excel, the function is named - CT.XML.XLRangesToMemory




High level graphic of XLRangesToMemory() function with parameters. Blue square node is the actual function with the parameters ordered.



Parameter Description


  1. Key parameter

    Key Handle to be used for the new custom range object.
  2. Reload parameter

    When creating this object for the first time, set this parameter to a positive value. Within Excel, when re-computing a worksheet where you do not wish to recreate the object, set this parameter to zero (0).
  3. Range1 parameter

    Range to write.
  4. Range2 parameter

    Range to write.
  5. Range3 parameter

    Range to write.
  6. Range4 parameter

    Range to write.
  7. Range5 parameter

    Range to write.
  8. Range6 parameter

    Range to write.
  9. Range7 parameter

    Range to write.
  10. Range8 parameter

    Range to write.
  11. Range9 parameter

    Range to write.
  12. Range10 parameter

    Range to write.
  13. Range11 parameter

    Range to write.
  14. Range12 parameter

    Range to write.
  15. Range13 parameter

    Range to write.
  16. Range14 parameter

    Range to write.
  17. Range15 parameter

    Range to write.


Extended information

Function Syntax

VB Syntax


String CTQueryDB.XLRangesToMemory( _
String Key, _
Long Reload, _
Variant Range1, _
Variant Range2, _
Variant Range3, _
Variant Range4, _
Variant Range5, _
Variant Range6, _
Variant Range7, _
Variant Range8, _
Variant Range9, _
Variant Range10, _
Variant Range11, _
Variant Range12, _
Variant Range13, _
Variant Range14, _
Variant Range15)


Excel Spreadsheet Syntax


=CT.XML.XLRangesToMemory(
Excel String Cell Key,
Excel Numeric Cell Reload,
XLRange Range1,
XLRange Range2,
XLRange Range3,
XLRange Range4,
XLRange Range5,
XLRange Range6,
XLRange Range7,
XLRange Range8,
XLRange Range9,
XLRange Range10,
XLRange Range11,
XLRange Range12,
XLRange Range13,
XLRange Range14,
XLRange Range15)


C++ Syntax


static std::string XLRangesToMemory(
std::string Key,
long Reload,
CTRangeDataCPP Range1,
CTRangeDataCPP Range2,
CTRangeDataCPP Range3,
CTRangeDataCPP Range4,
CTRangeDataCPP Range5,
CTRangeDataCPP Range6,
CTRangeDataCPP Range7,
CTRangeDataCPP Range8,
CTRangeDataCPP Range9,
CTRangeDataCPP Range10,
CTRangeDataCPP Range11,
CTRangeDataCPP Range12,
CTRangeDataCPP Range13,
CTRangeDataCPP Range14,
CTRangeDataCPP Range15);


DotNET Syntax


System.String CTQueryDBSA.XLRangesToMemory(
System.String Key,
System.Int32 Reload,
CTRangeData Range1,
CTRangeData Range2,
CTRangeData Range3,
CTRangeData Range4,
CTRangeData Range5,
CTRangeData Range6,
CTRangeData Range7,
CTRangeData Range8,
CTRangeData Range9,
CTRangeData Range10,
CTRangeData Range11,
CTRangeData Range12,
CTRangeData Range13,
CTRangeData Range14,
CTRangeData Range15);

Parameter data types

ArgNameArgTypeIsKey
KeyStringFALSE
ReloadLongFALSE
Range1RangeFALSE
Range2RangeFALSE
Range3RangeFALSE
Range4RangeFALSE
Range5RangeFALSE
Range6RangeFALSE
Range7RangeFALSE
Range8RangeFALSE
Range9RangeFALSE
Range10RangeFALSE
Range11RangeFALSE
Range12RangeFALSE
Range13RangeFALSE
Range14RangeFALSE
Range15RangeFALSE


Example Inputs

The first column represents the name of the parameters. The second column specifies whether the parameters are optional or not. Finally the last column provides some sample input data.
Function call input string-keys are always in the format : "NAME.EXTTAG.TICKER" The "EXTTAG.TICKER" part is determined from the output of other, capetools, object creation functions.


ArgNameIsOptional (Excel only)Example
KeyFALSEMyMemoryXLRange
ReloadFALSE1
Range1FALSEXLRangesToMemory_Range1_Range (creates a range object)
Range2TRUEXLRangesToMemory_Range2_Range (creates a range object)
Range3TRUEXLRangesToMemory_Range3_Range (creates a range object)
Range4TRUEXLRangesToMemory_Range4_Range (creates a range object)
Range5TRUEXLRangesToMemory_Range5_Range (creates a range object)
Range6TRUEXLRangesToMemory_Range6
Range7TRUEXLRangesToMemory_Range7
Range8TRUEXLRangesToMemory_Range8
Range9TRUEXLRangesToMemory_Range9
Range10TRUEXLRangesToMemory_Range10
Range11TRUEXLRangesToMemory_Range11
Range12TRUEXLRangesToMemory_Range12
Range13TRUEXLRangesToMemory_Range13
Range14TRUEXLRangesToMemory_Range14
Range15TRUEXLRangesToMemory_Range15


Example range for parameter : Range1

Within Excel, a range such as this can be passed directly into the Range1 parameter.

17
28
39
410
511
612

Example C# API usage for setting the range data for parameter : Range1



CTQL.CTRangeData XLRangesToMemory_Range1 = new CTQL.CTRangeData();

System.Text.StringBuilder XLRangesToMemory_Range1_builder =
new System.Text.StringBuilder(100);

XLRangesToMemory_Range1_builder.Append("{");
XLRangesToMemory_Range1_builder.Append("1	 | 7 ;");
XLRangesToMemory_Range1_builder.Append("2	 | 8 ;");
XLRangesToMemory_Range1_builder.Append("3	 | 9 ;");
XLRangesToMemory_Range1_builder.Append("4	 | 10 ;");
XLRangesToMemory_Range1_builder.Append("5	 | 11 ;");
XLRangesToMemory_Range1_builder.Append("6	 | 12");
XLRangesToMemory_Range1_builder.Append("}");

// Parse the string into the Range object.
XLRangesToMemory_Range1.RangeFromStr( XLRangesToMemory_Range1_builder.ToString() );


Example range for parameter : Range2

Within Excel, a range such as this can be passed directly into the Range2 parameter.

17
AHi mum
39
410
B11
63.56

Example C# API usage for setting the range data for parameter : Range2



CTQL.CTRangeData XLRangesToMemory_Range2 = new CTQL.CTRangeData();

System.Text.StringBuilder XLRangesToMemory_Range2_builder =
new System.Text.StringBuilder(100);

XLRangesToMemory_Range2_builder.Append("{");
XLRangesToMemory_Range2_builder.Append("1	 | 7 ;");
XLRangesToMemory_Range2_builder.Append("'A'	 | 'Hi mum' ;");
XLRangesToMemory_Range2_builder.Append("3	 | 9 ;");
XLRangesToMemory_Range2_builder.Append("4	 | 10 ;");
XLRangesToMemory_Range2_builder.Append("'B'	 | 11 ;");
XLRangesToMemory_Range2_builder.Append("6	 | 3.56");
XLRangesToMemory_Range2_builder.Append("}");

// Parse the string into the Range object.
XLRangesToMemory_Range2.RangeFromStr( XLRangesToMemory_Range2_builder.ToString() );


Example range for parameter : Range3

Within Excel, a range such as this can be passed directly into the Range3 parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : Range3



CTQL.CTRangeData XLRangesToMemory_Range3;

XLRangesToMemory_Range3 = new  CTQL.CTRangeData("String Data");

Example range for parameter : Range4

Within Excel, a range such as this can be passed directly into the Range4 parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : Range4



CTQL.CTRangeData XLRangesToMemory_Range4;

XLRangesToMemory_Range4 = new  CTQL.CTRangeData(100);

Example range for parameter : Range5

Within Excel, a range such as this can be passed directly into the Range5 parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : Range5



CTQL.CTRangeData XLRangesToMemory_Range5;

XLRangesToMemory_Range5 = new  CTQL.CTRangeData(56.554);

Example range for parameter : Range6

Within Excel, a range such as this can be passed directly into the Range6 parameter.


Example C# API usage for setting the range data for parameter : Range6





Example range for parameter : Range7

Within Excel, a range such as this can be passed directly into the Range7 parameter.


Example C# API usage for setting the range data for parameter : Range7





Example range for parameter : Range8

Within Excel, a range such as this can be passed directly into the Range8 parameter.


Example C# API usage for setting the range data for parameter : Range8





Example range for parameter : Range9

Within Excel, a range such as this can be passed directly into the Range9 parameter.


Example C# API usage for setting the range data for parameter : Range9





Example range for parameter : Range10

Within Excel, a range such as this can be passed directly into the Range10 parameter.


Example C# API usage for setting the range data for parameter : Range10





Example range for parameter : Range11

Within Excel, a range such as this can be passed directly into the Range11 parameter.


Example C# API usage for setting the range data for parameter : Range11





Example range for parameter : Range12

Within Excel, a range such as this can be passed directly into the Range12 parameter.


Example C# API usage for setting the range data for parameter : Range12





Example range for parameter : Range13

Within Excel, a range such as this can be passed directly into the Range13 parameter.


Example C# API usage for setting the range data for parameter : Range13





Example range for parameter : Range14

Within Excel, a range such as this can be passed directly into the Range14 parameter.


Example C# API usage for setting the range data for parameter : Range14





Example range for parameter : Range15

Within Excel, a range such as this can be passed directly into the Range15 parameter.


Example C# API usage for setting the range data for parameter : Range15






Example function usage


The C# example below contains all the sub-function calls leading up to this function call. As a result, the example can contain a lot of code.

The VB.NET, J#, C++.NET, Java, Excel VBA, Visual Basic 6 (via COM) and C++ examples below contain function code stubs for the calls leading up to this function call. However, the function call for this function is displayed.
You can easily reproduce the stub functions code from the C# example.


If you are accessing this functrion via the MiniXL libraries, this function is present within the CT.QL.Utils20 MiniXL Excel Addin.

Within our Excel Example Addin Generator, we have used the following QuantTools sub-functions in order to prepare the arguments needed to call the XLRangesToMemory() function. If you are executing this function via the MiniXL libraries, the module addin name, (in brackets, to the right of the sub-functions listed below), indicates the MiniXL library in which the sub-function is held. You will need to load this library into your Excel session (along with any other libraries that the sub-function call within the addin requires (ie - CT.QT.Utils20 addin in almost all cases) in order for the example to compute successfully.


The following four examples demostrate calling this function within a Microsoft .NET environment

The following four examples demostrate calling this function within a non .NET environment

The following is a sample output from executing the XLRangesToMemory() function call


MyMemoryXLRange_3.CUSTOM.0

Copyright (c) 2003-2007 CapeTools - All Rights Reserved.