Hex Editor - Binary File Editing Software for Windows
Download Hex Editor Neo Hide this button

ISequence Interface

This interface is implemented by a sequence object created through a File Document object. Use the methods of this interface from a scripting languages to construct a pattern to be passed to various methods of the IFileDocument interface.

Declaration

interface ISequence extends ${IDispatch} {
    // Properties
    readonly ${Empty}: boolean;
    ${Length}: number;
    [${Value}: number]: number;

    // Methods
    ${AddData}(Type: ${SequenceDataType}, Values: number[]): void;
    ${AddText}(Text: , Unicode: ): void;
    ${Clear}(): void;
    ${Copy}(): ${ISequence};
    ${CreateSubSequence}(Index: number, Length: number): ${ISequence};
    ${Remove}(Index: number, Length: number): void;
}
// This interface is not available in managed environment
// This interface is not available in native environment

ISequence Properties

Empty

readonly Empty: boolean;
// This property is not available in managed environment
// This property is not available in native environment

true if the sequence is empty or false otherwise.

Length

Length: number;
// This property is not available in managed environment
// This property is not available in native environment

Retrieve or change the current sequence length. Sequence length is expressed in bytes. When you change the sequence length, it is either truncated or extended. If the sequence was extended, it may contain garbage.

Value

[Value: number]: number;
// This property is not available in managed environment
// This property is not available in native environment

Retrieve the byte from sequence.

ISequence Methods

AddData

AddData(Type: ${SequenceDataType}, Values: number[]): void;
// This method is not available in managed environment
// This method is not available in native environment
Type
Type of the data to add. See SequenceDataType enumeration for more information.
Values
Any number of additional parameters which are added to a sequence. The type parameter describes the way they are interpreted.

Add numeric data to a sequence. This method is used to add bytes, words, double words, quad words, floats and doubles to a sequence. Data is added to the end of the sequence.

Adding values

var fdoc = new ActiveXObject("FileDocument.FileDocument");
var seq = fdoc.${CreateSequence#IFileDocument.CreateSequence}();

seq.AddData(SequenceDataBytes, 0x0d, 0x0a); // add two bytes to a sequence
seq.AddData(SequenceDataDwords | SequenceDataBigEndian,
        0x12345678, 0xfedcba98, 0, 70000); // add a number of big-endian double words to a sequence

AddText

AddText(Text: , Unicode: ): void;
// This method is not available in managed environment
// This method is not available in native environment
Text
A string to be added.
Unicode
true to treat string characters as UNICODE or false to treat them as ANSI.

Add textual data to a sequence. New data is appended to the end of the sequence.

Adding text

var fdoc = new ActiveXObject("FileDocument.FileDocument");
var seq = fdoc.${CreateSequence#IFileDocument.CreateSequence}();

seq.AddText("<p>", false);

Clear

Clear(): void;
// This method is not available in managed environment
// This method is not available in native environment

Clear the sequence.

Copy

Copy(): ${ISequence};
// This method is not available in managed environment
// This method is not available in native environment

Create a copy of the sequence.

CreateSubSequence

CreateSubSequence(Index: number, Length: number): ${ISequence};
// This method is not available in managed environment
// This method is not available in native environment
Index
Starting index of a sub-sequence.
Length
Length of the sub-sequence.

Create a sub-sequence of this sequence.

Remove

Remove(Index: number, Length: number): void;
// This method is not available in managed environment
// This method is not available in native environment
Index
Index of the starting byte to remove.
Length
The number of bytes to remove.

Remove a part of the sequence.