https://help.tallysolutions.com/docs/td9rel54/tdl_reference/release_4_61.htm

What’s New in Release 4.61

COM Data Types Support

In Release 4.6, a new Definition Type COM Interface, a new Action Exec COM Interface, and new Functions $$COMExecute and $$IsCOMInterfaceInvokable had been introduced to extend Support for COM Servers. However, this support was limited to only a few COM Data Types.

From Release 4.61 onwards, the following COM Data Types will also be supported:

COM Data Type

TDL Data Type

Other Permissible TDL Data Types

Range of Values/Other Details

String

String

Number, Date,

Logical, Amount

Float

Number

String, Amount

3.4 * 10^-38 to 3.4 * 10^38

Double/Number

Number

String, Amount

1.7 * 10^-308 to 1.7 * 10^308

Currency/Amount

Amount

String, Number

This would have a precision of 4 decimal places, rather than 5, as in Tally.ERP 9. If Tally sends the number in 5 decimal places, DLL will round it off to 4 decimal places.

Char

String(1st character of String is used)

Number, Date, Logical, Amount (Only the First letter) For e.g., if the number is 987, then the result char would be 9 and similarly, for the other data types. For Date, it depends on the Date Format.

Single Character

Byte/Unsigned char

Number

String, Amount

0 to 255

Short/Wchar

Number

String, Amount

-32,768 to 32,767

Unsigned short

Number

String, Amount

0 to 65,535

Long

Number

String, Amount

-2,147,483,648 to 2,147,483,647

Long Long

Number

String, Amount

-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807

Unsigned Long

Number

String, Amount

0 to 4,294,967,295

Unsigned Long Long

Number

String, Amount

0 to 18,446,744,073,709,551,615

Integer

Number

String, Amount

-2,147,483,648 to 2,147,483,647

Unsigned Integer

Number

String, Amount

0 to 4,294,967,295

Bool/Boolean/ Logical

Logical

String (Yes/No, 0/1, True/False)

True/False

Date

Date

String

Variant

String, Number, Date, Logical, Amount

This can be an Out or InOut parameter. The value for the data type can be any one of the following data types, viz String, Amount, Number, Date OR Logical.

Scode

Number

String

0 to 4,294,967,295

This is a kind of an error code data type, used by Windows API.

The parameters can also be of the Other Permissible TDL data types, as mentioned in the table, in place of the data types mentioned in the column titled ‘TDL Data Type’. Irrespective of whether the parameter is an In, Out OR InOut parameter, Tally implicitly converts these data types to the respective COM Data Types.

In Release 4.6, while declaring the Parameters for COM Interface, only a limited number of data types could be accepted as data type for the parameter. Let’s understand this with the help of the following example:

DLL C o de

TDL Code - COM Interface Definition

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace MathLib

{

public class MathClass

{

public double Add(double pDouble)

{

return pDouble + 9;

}

}

}

[COM Interface : TSPL Smp Add]

Project : MathLib

Class : MathClass

Interface : Add

Parameters : p1 : Number : In

Returns : Number

In the codes shown in the table, the Interface Add of Class MathClass had the Parameter Data type as Double in DLL, while the same had to be mapped to Number as the Parameter Data type in TDL.

From Release 4.61 onwards, the COM Data Types listed in ‘Other Permissible TDL Data Types’ column in the table are also supported. Thus, in this particular example, the data type of the Parameter can also be specified as Double in place of Number, and hence, the same can be rewritten as:

Parameters : p1 : Double : In

However, while invoking the COM Server, the data type must be a TDL Data Type, viz. Number, String, Amount, Date OR Logical.

Example

[Function : TSPL Smp Addition]

Parameter : InputNo : Number

00 : Exec COM Interface : TSPL Smp Add : ##InputNo

10 : Log : $$LastResult

Note: It is not necessary to have the above TDL Data Type as Number. It could also be a String or an Amount. However, the value within the String should be a Number.