
program NoName;
{$MODE delphi}{$H+}

uses
{$ifdef unix}
  cthreads,
  cmem, // the c memory manager is on some systems much faster for multi-threading
{$endif}
 //heaptrc, lineinfo,
 Interfaces, // this includes the LCL widgetset
 Classes,SysUtils,Forms,
 base2,VStack,BASini,MyThread,datalist,BASICunit;
{$MAXFPUREGISTERS 0}
{$IFNDEF Darwin}{$R *.res}{$ENDIF}
begin
{$if declared(UseHeapTrace)}  //set by the compiler when it includes the heaptrc unit.
 SetHeapTraceOutput('trace.log');
{$endif}
 Application.Scaled:=True;
 Application.Initialize;
 InitVirtualStack(VirtualStackSize);
 init;
 BASICThread0:=TBASICFirstThread.Create(FirstThreadPriority,SystemStackSize);
 (TThread.CurrentThread).Yield;
 sleep(DrawStartDelay);
 BASICThread0.start;
 (TThread.CurrentThread).Yield;
 sleep(DrawStartDelay);
 Application.ProcessMessages;
 repeat
     MainTask;
 until StopRequest or AllThreadsList.finished;
 if StopRequest then
      begin
        AllThreadsList.suspend;
        AllChannelList.FreeAll;
        AllThreadsList.kill;
      end;
 sleep(10);
 MainTask;
 Finish;
 DiscardVirtualStack;
 if textmode or GraphMode then
   Application.Run;
 end.
