YOU ARE VIEWING DOCUMENTATION FOR ioL v.1. Click here for documentation for older v.0.9x versions of ioL.
ioL

Programming manual (doc.iol.science)



What's new?

In response to user feedback, ioL has been revised and expanded with a new syntax convention.
For documentation on the older 0.9x versions, click here.

Getting started

Here is a quick guide to help you get started with ioL. In this section, there is also a more in-depth tutorial which will give you a tour of many features of ioL's powerful markup language.


What is an ioL program?

An ioL program is fundamentally just an ordinary console-style program like any other that you might write for your operating environment. The difference is that when writing an ioL program, you don't output plain-text characters intended to be viewed directly by the user in a plain-text terminal; instead you output marked-up content intended to be rendered into a graphical user interface on the screen.

For your program to work correctly with ioL, you must ensure your program produces output in accordance with ioL's syntax rules, and ensure that your program is started in the correct environment, so the ioL system can take control of your program's input and output.

To run a program through an ioL environment

If you try to run an ioL program in a plain TTY terminal window, the user will just see the raw markup code that your program outputs, rather than the graphical program interface you want them to interact with.

Without ioL (traditional program terminal)

In the
traditional environment, standard output and input flow directly to and from a
plain TTY terminal.

Your program must be run in an ioL console environment for its output to be interpreted in the correct way. You can use the iol command line utility to run your program in this way:

To run a command through an ioL console environment, from the Linux command line:

$ iol command

This sets up an ioL console environment for your program to run inside. This allows your program to print more expressive output, such as images, buttons, and formatted text.

With ioL... (modified environment)

When run in a
modified environment, the program is detached from the TTY terminal and
reattached to an ioL console.

To run a command which has multiple arguments, use a double-hyphen to separate your program's command from the iol command as follows...

$ iol -- command arg1 arg2 etc...

To print text to an ioL console

Most of the text your program prints to standard output will be printed to the ioL console in the way you write it, however there are some differences due to how ioL interprets your program's output.

To produce a line break, print this character sequence </n>.

Tags

A tag is a character sequence you can output from your program which is enclosed within angle brackets: < ... >. These can be used to print special formatting instructions, graphics or user interaction.

Example

<box {This text is enclosed in a box,}>
<span bold=true size=32 {and this text is in a large bold font.}>
This text is enclosed in a box,
and this text is in a large bold font.

Generating program input from the console

Unlike a traditional terminal, the user's keyboard input won't be sent back to your application unless you give the user some means to do so.

Use the <put> or <putLn> tags to send input back to your application. This code can be assigned to an event field (e.g. onClick) so the put instruction is executed when the user performs some interaction, such as clicking a button.

The following markup code places an input box and a button on the screen, through which the user can send input to your application. It will send your program the contents of the input box whenever the user clicks the OK button, and then clear the input box ready for the user's next input:

<ibox:input> <button {OK} onClick=<putLn ibox>,ibox.clear>
OK