Command: ChannelsToArray
- Updated2024-09-12
- 2 minute(s) read
Command: ChannelsToArray
Command: ChannelsToArray
Possible spellings: ChannelsToArray, ChnToValue, ChnToVariant
Converts a list of channels into a type-safe array. The array is a string type for text channels and otherwise a double type. You cannot access this array from VBS scripts. However, you can exchange the data with other applications that expect type-safe arrays.
Input Parameters
![]() |
Specifies one or more channels. |
![]() |
Specifies whether DIAdem transposes the array with the channel data. DIAdem does not transpose this array by default. |
Return Parameters
ReturnValue | The return value is a Variant variable type. |
![]() | Note Use the ChannelsToArray syntax instead of ChnToValue or ChnToVariant. |
VBS scripts only recognize Variant data types. A variant variable can contain various subtypes, such as integer, long, or string. In VBS scripts you can use only variant variables. However, exchanging data with other applications may involve data that is not a variant data type. DIAdem channels also have a defined data type. Use the ChannelsToArray command to exchange data with other applications that return type-safe arrays and save the data type-safe in channels.
Example
The following example assigns the contents of the first channel of the first group to an array and then outputs the size of the array.
VBScript | Python |
Dim MyArray MyArray = ChannelsToArray("[1]/[1]") Call Msgbox(UBound(MyArray))