Property: BlockLength for FixedWidthBlock
- Updated2024-09-12
- 1 minute(s) read
DataPlugin > Properties > Property: BlockLength for FixedWidthBlock
Property: BlockLength for FixedWidthBlock
Specifies the number of values that a channel in the FixedWidthBlock contains.
If the number is -1, the block extends to the end of the file.
Object.BlockLength
Object | FixedWidthBlock Object with this property |
Object.BlockLength | LongInteger with read and write access |
![]() | Note If the property SampleWidth is not equal to 1 in a FixedWidthBlock, the BlockLength contains the number of lines in a text file. |
The following example reads a group name and the length of a FixedWidthBlock from a text file. Then the example creates this channel group with the property BlockLength and the channel MyChannel. The example skips the lines specified by the BlockLength before reading in the channel values:
Dim oBlock : Set oBlock = File.GetFixedWidthBlock Dim GroupName : GroupName = File.GetNextStringValue(eString) oBlock.BlockLength = File.GetNextStringValue(eI32) Set oChannelGroup = Root.ChannelGroups.Add(GroupName) Call oChannelGroup.Properties.Add("BlockLength", oBlock.BlockLength) Dim oChannel : Set oChannel = Block.Channels.Add("MyChannel", eI16) oChannel.Formatter.CharacterCount = 4 oChannel.Formatter.SampleWidth = 4 Call oChannelGroup.Channels.AddDirectAccessChannel(Channel) Call File.SkipLines(oBlock.BlockLength+1) oBlock.Position = File.Position