STATISTICA







Using STADEV with Delphi
Creating a new file

This example creates a new STATISTICA data file with 10 variables and 10 cases and fills it with random numbers.

Note that to use STADEV from Delphi, you must include the stadev32 unit into your compilation: uses StaDev32, call the desired functions, and put stadev32.dll in your path and in the Delphi search path


procedure TestCreateFile;
const
   CreateFileName = 'c:\stat\files\newdata.sta';
var
   hSF: HSTAFILE;
   i: smallint;
   j: longint;
   d: double;
begin
   hSF := StaCreateFile(10, 10, CreateFileName);
   if (0 = hSF) then
      begin
      writeln('Could not create STATISTICA file');
      exit;
      end;

   { change the names of the first three variables}
   StaSetVarName(hSF, 1, 'ABC');
   StaSetVarName(hSF, 2, 'MIDDLE');
   StaSetVarName(hSF, 3, 'XYZ');

   { fill the file with random numbers}

   Randomize;
   for i := 1 to 10 do
      for j := 1 to 10 do
         begin
         StaSetData(hSF, i, j, Random);
         end;

   StaCloseFile(hSF);
end;
Back to List of Programs



[StatSoft]
2300 East 14th Street, Tulsa, OK 74104
Phone: (918) 749-1119; Fax: (918) 749-2217

[StatSoft]e-mail: info@statsoft.com

©Copyright StatSoft, Inc., 1984-2004.
StatSoft, StatSoft logo, STATISTICA, SEWSS, SEDAS, Data Miner, SEPATH and GTrees are trademarks of StatSoft, Inc.