Edit Anything

Professional text and hex editing
with Binary Templates technology.



SweetScape Knowledgebase

KB1027: Can I read data from a file without defining a template variable?

When defining a variable in a template, you can test the value of that variable to determine how to parse the file (reading the value of the variable will read data from your file). For example:

    int tagType;
    if( tagType > 5 )
    {
        ...
    }

In this example comparing 'tagType' reads data from the disk. Sometimes it is necessary to read data from a file before defining a template variable. This type of reading can be done with the ReadByte, ReadUByte, ReadShort, ReadInt, ReadUInt, etc. functions. These functions require a read position to be passed to them, which is usually just the value returned by the 'FTell' function. For example, this code reads data from a file without defining a variable:

    if( ReadInt(FTell()) > 5 )
    {
        ...
    }




Newsletter - Receive special offers, tips, tricks and news. Join now



010 Editor v14.0.1 is here!
What's new?


Navigation


Products

010 Editor














E-mail: info@sweetscape.com