unit basicunit;
{$mode delphi} {$H+}
interface
uses  Classes, SysUtils;
Procedure ModulesInit;
Procedure ModulesDone;
procedure BASICmain;

Const DrawTimeInterval=1;
Const DrawStartDelay=1;

implementation
uses Forms, math, graphics,
 windows,winlib,
  base,base2,textfrm,textfile,arrays,affine,graphsys,
  math2sub,datalist,baslib,graphlib,debugdg,paintfrm,
  MyThread,assignlib,
 mathc,arraysc,baslibc,graphlibc,
 mathlibc, mathlib;
{$MAXFPUREGISTERS 0}





(* Modules initialize and dispose *)
Procedure ModulesInit;
begin
end;
Procedure ModulesDone;
begin
end;

(* Main Program *)
procedure BASICmain;
var _A:TArray2C;
var _I:Complex=(x: 0.0; y: 0.0);
var __own1_00000:Complex=(x: 0.0; y: 0.0);
var __own2_00001:Complex=(x: 0.0; y: 0.0);
var Missing:Boolean;
var ChannelList:TChannelList;
begin
 ChannelList:=TChannelList.create;

_A:=TArray2C.create(1,10,1,2);
try
//  DIM a(10,2)

//  OPEN #1:NAME "F:\TEMP\InternalTest.CSV", RECTYPE CSV, ACCESS INPUT
ChannelList.Open(1,'F:\TEMP\InternalTest.CSV','INPUT','CSV','SEQUENTIAL',maxint, false );
//  FOR i=1 TO 10
__own1_00000 := 10 ;
_I := 1 ;
while (_I <= __own1_00000) do begin
//     READ #1:a(i,1),a(i,2)
with TDataList.create do 
try
 Missing:=false;
 svExtype:=  ReadData(ChannelList.channel(1),'nn',[ioReadWrite,ioCharacterByte],'? ',MaxNumberDouble,nil,false,rsNone,4);
 if count>0 then  _A.elements^[_A.index(_I,1)] := FloatVal( strings[0]) ;
 if count>1 then  _A.elements^[_A.index(_I,2)] := FloatVal( strings[1]) ;
if svExtype<>0 then setexception(svExtype);
finally
 free;
end;

//  NEXT i
_I := _I + 1 ;
end;
//  CLOSE #1
ChannelList.close(1);
//  MAT PRINT a
console.MATPRINT([],rsNone, false ,[_A,2]);
//  END

finally
_A.free;
ChannelList.free; 
end;
end;{end main}
initialization
  AppName:='F:\Lazarus\BASICAcc1.2\InternalReadIndexedVar';
  SystemStackSize := 16711680;
  signiwidth0:=15;
  TextMode := true ;
  GraphMode:= false ;
  BMPSize:=BMP1001;
  TextProblemCoordinate:= false ;
  UseCharInput:= false ;
  FontCharSet:=1;
  FontSize:=0;
  FontName:='default';
  FontStyle:=[];
  FirstThreadPriority:=tpNormal;



Finalization



end.
