HyPhy Batch Language

From HyPhy Wiki
Jump to: navigation, search
This page is a work in progress. Current status of the page is: being populated.

Contents

Introduction

A batch language (scripting language) is essentially a bunch of commands that are placed together in a file so that they can be executed one after another. The HyPhy batch language (HBL) provides the most complete access to all the functions within HyPhy.

Basic syntax

Its syntax is quite similar to C. For example, it uses curly braces to enclose blocks of statements, and comments are enclosed in /* ... */ or started by //. Here is how you would write "Hello world!" in HBL:

 fprintf (stdout, "Hello world!");

If you've ever programmed in C, the resemblance should jump out at you. However, HBL does not adhere exactly to C programming syntax and conventions. One very important difference is that HBL uses dynamic typing. In other words, you do not have to declare a variable before using it. For example, the following line:

x = 1;

defines a numerical (float) variable named "x" because it has been assigned a number. This approach has a number of potential pitfalls that you need to be aware of. For example, this line is perfectly valid in HBL:

x = x + y; /* y has never been defined and is interpreted as 0 */

Flow control

Language Reference

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox