Skip to content

HSCRIPT File Formatđź”—

HDevelopEVO programs consist of plain text files with the file extension .hscript.

Calling Operatorsđź”—

When using one of the HALCON operators, HDevelopEVO behaves identical to HDevelop, with this general signature of an operator:

operator (iconic input : iconic output : control input : control output)

Declaring and Calling Proceduresđź”—

In HDevelopEVO, you write the code of a procedure just as you write the “main” program part, as procedures are just a part of the program file. Procedures are distinguished by certain keywords.

Adhere to the following:

  • A procedure must start with one proc statement and end with one endproc statement.
  • You can either use a dedicated mainprocedure or put all lines of code that are not part of a procedure (“standalone statements”) at the end of the program. That means: In the HSCRIPT file, all procedures (that is, all proc ... endproc blocks) must come before any standalone statements.
  • There can only be one procedure called main. If this procedure exists (that is, if there is a proc main (...) endproc block), it serves as the entry point of the program. In this case, the main block does not need to be at the end, but there must not be any further standalone statements.
  • Parameters are defined using the following keywords:

    • Iconic input: object keyword

    • Control input: tuple keyword

    • Iconic output: out object keyword

    • Control output: out tuple keyword

  • Parameters must be separated by , (commas).

General syntax of procedure declaration
proc proc_name (object InputImage, tuple InputParam, out object OutputImage, out tuple OutputParam)
  (...)
endproc

When declaring a procedure, the order of the parameter types (iconic in, control in, iconic out, control out) is not fixed.

Example

The following two declarations both are valid and do the same:

proc initialize_visualization_1 (tuple Width, 
                                 tuple Height, 
                                 out tuple WindowHandle, 
                                 out tuple WindowHandleText)
proc initialize_visualization_2 (out tuple WindowHandle, 
                                 out tuple WindowHandleText,
                                 tuple Width,
                                 tuple Height)
Still, when calling the above procedures, you have to provide the correct order:
initialize_visualization_1 ('600', '400', WindowHandle, WindowHandleText)

initialize_visualization_2 (WindowHandle, WindowHandleText, '600', '400')