The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



ReadFromASC


Unit:SDL_datatable
Class: TDataTable
Declaration: [1] function ReadFromASC (FName: string; PosX, PosY: longint; ReplaceIDs: boolean): integer;
[2] function ReadFromASC (InStream: TStream; PosX, PosY: longint; ReplaceIDs: boolean): integer;
[3] function ReadFromASC (ClipBd: TClipBoard; PosX, PosY: longint; ReplaceIDs: boolean): integer;

The function ReadFromASC reads data from a data source formatted in ASC Format. In contrast to the method ImportASC, the function ReadFromASC allows to position the read data within the existing table; it is available in three versions: version [1] reads from a text file, version [2] from a stream, and version [3] from the Windows clipboard.

The parameter FName defines the name of the file to be read (version [1]), the parameter Instream specifies the stream to be read from (version [2]). The parameters PosX and PosY determine the first cell (upper left corner) where to store the read data. The boolean parameter ReplaceIDs determines whether the column and row identifiers, and the measurement scale types are to be replaced by the new ones. Any excess data which do not fit into the data table are discarded.

The function ReadFromASC returns the following error codes:
0 no error
-1 error in specification of number of features
-2 error in specification of number of objects
-3 error in ClInf/NamFeat/NamObj flags
-5 invalid class information
-6 invalid numeric data
-7 invalid data on clipboard
-8 file not found

Hint: Please note that version [2] of ReadFromASC starts to read from the current position of the stream and expects correct header information.



Last Update: 2023-Dec-14