DIAdem Help

Content Type
Programming Language
Current manual
Table of Contents

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
ObjectFixedWidthBlock
Object with this property
Object.BlockLengthLongInteger 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
In This Section
Was this information helpful?