Home    Cart    Free Download    Manual

Installation:
  Free Downloads
  The H2O Family
  Install Notes

Programming:
  Prerequisites
  H2O Whitepaper
  Online Manual
  Code Examples
  H2O Free Support


What's H2O?
H2O is programming made for the web.

What's it like?
H2O is English-like. If you know some Perl, VB, ASP, or PhP you'll be immediately productive in H2O. It runs on Linux, Mac, Unix, and Windows.

How do I try it?
Download H2O for free. Get it from hosting providers. Or buy online.

Where does H2O come from?
The language was invented by Aestiva. H2O stands for:
   HTML with
   HTML/OS
   Overlays.


Arithmetic and Relational Operators
All the familiar operators apply. Like Java, H2O uses the + operator for string concatenation.



OperatorDescription
&Text Concatenation
+Addition or Text Concatenation
-Subtraction
*Multiplication
/Division
=Assignment or Comparison
<>Not Equal Comparison
!=Not Equal Comparison
<Less Than Comparison
>Greater Than Comparison
<=Less Than or Equal Comparison
>=Greater Than or Equal Comparison
!=Not Equal Comparison
+=Add and Assignment
~Begins with Comparison
~~Contains Comparison
-=Subtract and Assign
&=Concatenate and Assign



H2O supports the following assignment shortcuts:

  • +=     --     a += 1 means a = a + 1
  • -=     --     a -= 2 means a = a - 2
  • &=     --     a &= "s" means a = a & "s"


The GOTO statement
Unlike programming languages such as Java, H2O
does include a GOTO statement. For example:



    IF loginID = "ERROR" THEN
      GOTO "/nologin.html"
    /IF

The GOTO statements may be used when imbedded in an HTML page above the
<HTML> tag or when below the </HTML> tag. It may not be used inside the display portion of a web page.

Quote Characters
H2O accepts three quote characters; the single quote, the double quote and the caret. The addition of the caret as a quote character was introduced to make it easy to encapsulate Javascript. For example:


    myvar = ^<A HREF="#" onclick='window.close();'>Exit^



Array Functions
H2O includes built-in array functions that make code easier to write and faster. For example, to re-sort a table by a specified column you write:



    mytable = SORTCOL(mytable,2)

This takes the table, sorts it by column 2 and saves it back to itself. As another example, consider reformatting an array and displaying it in a page. This is done with a single DISPLAY tag. One can write:


    DISPLAY NAME=mytable
       ^<HREF="[1]">[2]</A><br>^
    /DISPLAY


This would convert the table mytable containing URLs in column 1, and names in column 2, into a series of hypertext links. (Note the use of the caret as a quoting character.)

Loops
H2O supports standard WHILE and FOR loops. It also supports the FOR loop across arrays. A While statement looks like:


    a=1
    myfactorial=1

    WHILE a <= 5 DO
      myfactorial = myfactorial * a
    /WHILE

A conventional FOR loop looks like:



    FOR NAME=a VALUE=1 To 5 DO
      myfactorial=1
      myfactorial = myfactorial * a

    /FOR

The two examples above calculate a factorial of the variable a.

In H2O, when looping across arrays, one uses a FOR loop specific for looping across tables. One writes, for example:


    FOR NAME=myURLs ROWNAME=thisURL DO
      DISPLAY
        "<A HREF=" + thisURL[1]+">" + thisURL[1] + "</A><BR>"

      /DISPLAY
    /FOR

This FOR loop executes the instructions between the DO and the /FOR
repeatedly until there are no more rows in the ariable myURLs. Each time through the loop the variable thisURL is filled with the next row of myURLs. This FOR loop takes a table of URLs and displays it in the web page as a series of hypertext links.

Home | Cart | Free Download | Online Manual
COPYRIGHT © 2005 Aestiva, LLC. ALL RIGHTS RESERVED.