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 _I:double=0;
var _X:double=0;
var _Y:double=0;
var __own1_00000:double=0;
var __own2_00001:double=0;
var Missing:Boolean;
var ChannelList:TChannelList;
begin
 ChannelList:=TChannelList.create;

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

//     PRINT x,y
console.PRINT([],rsNone, false ,[TComplex.create(_X), TNewZone.create ,TComplex.create(_Y), TNewLine.create ]);
//  NEXT i
_I := _I + 1 ;
end;
//  CLOSE #1
ChannelList.close(1);
//  END

finally
ChannelList.free; 
end;
end;{end main}
initialization
  AppName:='F:\Lazarus\BASIC81xJa\ComplexREADInternal';
  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.
