Hex Editor
Hex Editor - Binary File Editing Software for Windows

Attaching Scripts

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

External functions referenced in your structure definition files must be defined in separate files. Hex Editor Neo supports functions written in JavaScript.

Use the following syntax to attach a script file to the structure definition file:

#pragma script(path-to-script-file)        
      

Path-to-script-file is a string containing the absolute or relative (to the structure definition file) path to a script file. Only Javascript external files (with any extension) are supported.

As with included files, Hex Editor Neo automatically rescans a file if it is modified outside the editor.

Examples

functions.js:

function f()
{
  return 10;
}

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

public struct A
{
  char array[f()];
};
      

javascript Keyword

In addition, starting with version 4.92, javascript code may be specified in the structure definition file using the new javascript keyword:

javascript
{
  function f()
  {
    return 10;
  }
};

public struct A
{
  char array[f()];
};
      

The number of javascript blocks is not limited. All blocks are processed before any structure is bound, so all functions declared in these blocks are always visible to any structure, regardless of the place where you define them.

< PreviousTopNext >
Copyright © 2012 HHD Software. All rights reserved.