Hex Editor
Hex Editor - Binary File Editing Software for Windows

External Functions

HHD Software - Hex Editor Serial Port Monitor USB Protocol Analyzer Network Monitor
 
 
 
< PreviousTopNext >

Hex Editor Neo allows you to use external functions in Structure Viewer expressions. External functions are defined in script files, attached to structure definition files using the #pragma script preprocessor directive.

An external function accepts zero or more parameters and must always return a value ("void" functions, or procedures are not supported). External function must be written in Javascript.

Hex Editor Neo automatically performs parameter type conversion when the function call is made. Although, make sure the value returned by the function is of correct type, as Structure Viewer expects a value of a given type in several places, such as in array declaration:

functions.js:
  
function GetArraySize()
{
    return 11/2;
}

structure.h:
#pragma script("functions.js")

struct A
{
    int array[GetArraySize()];         // error here: script returns a floating-point number, integer expected
    int array[int(GetArraySize())];    // correct
};
  
< PreviousTopNext >
Copyright © 2012 HHD Software. All rights reserved.