Passing data to GAMS

Top  Previous  Next

In the Delphi program CSV files are created which contain the data to be passed.  These CSV files are written by code such as

 

   AssignFile(Fiwrite, 'distancetbl.csv');

   Rewrite(fiwrite);

   write(fiwrite,'fromdelphi');

   for j:= 1 to 3 do

      write(fiwrite,',',stringgrid1.cells[j,0]);

   writeln(fiwrite);

   for i:= 1 to 2 do begin

      write(fiwrite,stringgrid1.cells[0,i]);

      for j:= 1 to 3 do

              write(fiwrite,',',stringgrid1.cells[j,i]);

      writeln(fiwrite);

   end;

   closefile(fiwrite);

 

which writes the distance matrix as stored in stringgrid1.