boaold /IDE/main.cs

Language C# Lines 63
MD5 Hash 66df919fc3e12a4e09b0f5528e759921 Estimated Cost $728 (why?)
Repository https://bitbucket.org/AdamMil/boaold View Raw File View Project SPDX
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
Boaide is a simple IDE for working with the Boa language.

Boa is the reference implementation for a language similar to Python,
also called Boa. This implementation is both interpreted and compiled,
targetting the Microsoft .NET Framework.

http://www.adammil.net/
Copyright (C) 2004 Adam Milazzo

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/

using System;
using System.Collections;
using System.IO;
using System.Windows.Forms;

namespace Boa.IDE
{

class App
{ public static readonly MainForm MainForm = new MainForm();

  public static string[] GetRawLines(TextBoxBase box)
  { ArrayList list = new ArrayList();
    string text = box.Text;
    int pos=0;
    while(pos<text.Length)
    { int index = text.IndexOf('\n', pos);
      if(index==-1) { list.Add(text.Substring(pos)); break; }
      else { list.Add(text.Substring(pos, index-pos+1)); pos=index+1; }
    }
    return (string[])list.ToArray(typeof(string));
  }

  [STAThread]
  static void Main()
  { Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);

    Runtime.Importer.ImportStandardModules();
    Modules.sys.path[0] = "";

    Application.Run(MainForm);
  }

  static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
  { ExceptionForm form = new ExceptionForm(e.Exception);
    form.ShowDialog();
  }
}

} // namespace Boa.IDE
Back to Top