larsa wrote:Hello
Probably. Please do a test.
Hello
In fact, I want to ask if the XLSReadWriteII5 control supports multithreading
Then I have done some tests on my project. The project mainly compares two different CVS files. There is only one answerfile and one examfile for each student
I have used multithreading for testing. I have opened 10 threads, and one thread has read 500 times. If something happens, there will be an address error. After searching the data, there is no discovery, so I want to ask
core code like:
//Open
AAnswerXLS := TXLSReadWriteII5.Create(nil);
AAnswerFile := AAnswerPath + ASheetName + '.csv';
ImportCSV(AAnswerXLS, 0, 0, 0, AAnswerFile, ',', True);
AAnswerSheet := AAnswerXLS.Sheets[0];
AExamXLS := TXLSReadWriteII5.Create(nil);
AExamFile := AExamPath + ASheetName + '.csv';
ImportCSV(AExamXLS, 0, 0, 0, AExamFile, ',', True);
AExamSheet := AExamXLS.Sheets[0];
//Read like this
function XLSPreciseReadCell(ASheet: TXLSWorksheet; Row, Col: Integer): string;
var
CellType: TXLSCellType;
begin
Result := string.Empty;
Col := Col - 1;
Row := Row - 1;
CellType := ASheet.CellType[Col,Row];
if CellType <> xctNone then
begin
Result := ASheet.AsString[Col,Row];
end;
end;