home *** CD-ROM | disk | FTP | other *** search
- { FormulaBuilder }
- { YGB Software, Inc. }
- { Copyright 1995 Clayton Collie }
- { All rights reserved }
-
- {* Unit which defines a dummy spreadsheet matrix object for use with *}
- {* the EIS demo series *}
-
- Unit ssheet;
- INTERFACE
- uses classes,sysutils;
-
- CONST
- MAXROWS = 10;
- MAXCOLS = 10;
-
- TYPE
- PDouble = ^Double;
- SheetMatrix = Array[1..MAXROWS,1..MAXCOLS] of double;
-
-
- TSpreadSheet = Class( TObject )
- SheetData : SheetMatrix;
- Constructor Create;
- end;
-
-
- Function ParseCellName( name : string; var row , col : word ):boolean;
-
- IMPLEMENTATION
-
- Function ParseCellName( name : string; var row , col : word ):boolean;
- var i,p : byte;
- rowstr, colstr : string[10];
- begin
- result := false;
- name := uppercase(name);
- if name[1] <> 'R' then exit;
- delete(name,1,1);
- p := pos('C',name);
- if p = 0 then exit;
- rowstr := copy(name,1,p-1);
- delete(name,1,p);
- colstr := name;
- try
- row := strtoInt(rowstr);
- col := strToInt(colstr);
- except
- exit;
- end;
- result := true;
- end;
-
-
-
-
- Constructor TSpreadSheet.Create;
- var r,c : integer;
- begin
- inherited create;
- for r := 1 to maxrows do
- for c := 1 to maxcols do
- SheetData[r,c] := random(45000) + 100 + random
- end;
-
- END.
-