I have tried your code in my computer and no problem, but the format of the indent was wrong.
Genie code indentation can be writed with tabs or spaces;
If you uses spaces you must to explicit how many... like this
[indent=4] at the start of the code. Like here http://manualgenie.blogspot.com.es/
But if you want to use tabs instead spaces (is more confortable) you must to ensure there is not spaces before any code line. Like here: http://genie.webierta.skn1.com/wiki/colecciones
For Vala/genie programming I use Geany editor and it has an option for replace all spaces in tabs, or all tabs in spaces in "Document" option of the task bar.
When the problem is how to use o where use "var" I will explain here:
Var is used for declare and define one identifier(variable) in only one code line and for be used temporaly. But if you want to have global scope into the class, getting it useful for all the "def" procedures of the class, you must declare at the start of the class. Like the example above. Also, if we use "init" for declare it the class must be defined as "GLib.Object"
class Arr:GLib.Object
a : array of int [] //declare
init
a = new array of int [100] //define
def arr_test()
i : int = 0
for i = 0 to 99
a[i] = i
for i = 0 to 99
print "%4d",a[i]
init
var v = new Arr()
v.arr_test()
Aslo, you can declare it but define after in your "def" procedures. Like in this example:
class Arr
a : array of int []
def arr_test()
a = new array of int [100]
i : int = 0
for i = 0 to 99
a[i] = i
for i = 0 to 99
print "%4d",a[i]
def arr_test2()
a = new array of int [120]
i : int = 0
for i = 0 to 119
a[i] = i
for i = 0 to 119
print "%4d",a[i]
init
var v = new Arr()
v.arr_test()
v.arr_test2()
Note: In this case we don't use "init", therefore is not needed the declaration :GLib.Object.