Property: SampleWidth for FixedWidthChannelFormatter
- Updated2024-09-12
- 1 minute(s) read
DataPlugin > Properties > Property: SampleWidth for FixedWidthChannelFormatter
Property: SampleWidth for FixedWidthChannelFormatter
Specifies how many consecutive values are read from a line in the text file for one channel. The default value for this property is 1.
Object.SampleWidth
Object | FixedWidthChannelFormatter Object with this property |
Object.SampleWidth | LongInteger with read and write access |
The following example shows the settings required for reading the lines listed below:
0127+098-765+432 0000-876+543+210 -128+654-321
The SampleWidth property specifies that two consecutive values are read from a line for each channel:
Dim oBlock: Set oBlock = File.GetFixedWidthBlock Dim oChannelGroup: Set oChannelGroup = Root.ChannelGroups.Add("Channelgroup") Dim oChn1 : Set oChn1 = oBlock.Channels.Add("Channel1", eI32) oChn1.Formatter.CharacterCount = 4 oChn1.Formatter.SampleWidth = 2 Call oChannelGroup.Channels.AddDirectAccessChannel(oChn1) Dim oChn2 : Set oChn2 = oBlock.Channels.Add("Channel2", eI32) oChn2.Formatter.CharacterCount = 4 oChn2.Formatter.SampleWidth = 2 Call oChannelGroup.Channels.AddDirectAccessChannel(oChn2) oBlock.Position = File.Position