.NET Script Heater, dynamic .NET Script Code
The .NET Script Heater enables you to equip your FlowHeater Definition with any desired .NET code. This means that there is no limit to the kinds of dynamic transformation possible.
Anything that cannot be achieved using the (extensive) functions (Heaters) that come with FlowHeater, you can program for yourself with the help of the .NET Script Heater straightforwardly in DOT.NET. Both the programming languages of C# (C-sharp) and VB.NET (Visual Basic) are supported.
Note: Some extremely complex scripts can be used. Even complete classes can be included as source.
The .NET Script Heater properties popup is really easy to operate. Using the Check Syntax button the code is compiled and, if applicable, errors are reported.
Access to parameters and data type conversion
The .NET Script Heater makes use of the same mechanisms as FlowHeater itself. Incoming data types are automatically converted into the necessary data types according to the format settings on the WRITE Adapter. In order to make use of these, five functions are available.
Note: x = 0 is the first parameter
Warning: In all functions, if the return value is NULL then the contents could not be converted.
The heater parameters can be accessed using the InValues array with the methods listed above. The sequence of parameters is the same as defined in Designer.
The result of your own transformation function is delivered as a return value for further processing by FlowHeater. The following .NET data types can be returned at present.
- A complex If-Then-Elseif…Else example. The .NET Script Heater is also introduced here, as an alternative and much more elegant way of achieving the same thing
- For data that is filtered by the Filter Heater, the filtered records are written to a separate file for further processing by the .NET Script Heater.
- Advanced Excel CSV data export. Here data grouping with the help of the .NET Script Heater is carried out.
or inspect the following short C# (C-sharp) Script code extracts for a brief introduction
Simple counter, returning 1, 2, 3, and so on… according to the number of records processed.
Extended counter including invocation of an additional function. Returning this time 2, 4, 6, and so on... according to the number of records processed.
A somewhat more complex calculation using an additional class, which processes the first heater parameter.
Imported namespaces and references
At present a fixed reference to the .NET System.dll is used, with this the following Namespaces
are imported. In a later version, it is planned to make it possible to configure references and imported namespaces in the properties popup window. This will also make it possible to integrate references to you own .NET DLLs.