ArrayList

Introduction

The ArrayList is a very powerful class, that is similar to an array, but objects can be added and removed dynamically and are stored as Object. So you can add strings, integers or for example Points or Gtk# forms.

In order to add en element at the end of the List, simply use Add(). To add several elements, try AddRange().
To insert somewhere else try Insert() or InsertRange().

To Remove elements you must use Remove() and RemoveRange().

C# sample

// ArrayListSample.cs
// (C) Copyright 2003 by Johannes Roith

using System;
using System.Collections;

class ArrayListSample {

        static void Main()
        {

                ArrayList arraylist1 = new ArrayList();


                

        }
}

MonoBasic sample

// ReadTextFile.vb
// (C) Copyright 2003 by Johannes Roith

imports System
imports System.Collections

Public Module ReadTextFile {

        Public Sub Main ()


        End Sub

 End Module

Writing a Textfile

A more interesting Example. Gets XML from the server, reads it and puts out a Textfile.