I was trying to read a text file to count the lines of the file:
unfortunately
each line in the file has more then 1024 characters
so i used BigText to read the file:
WorkFileL.OPEN(FileNameP);
WorkFileL.TEXTMODE := TRUE;
WHILE WorkFileL.POS < WorkFileL.LEN DO BEGIN
IF WorkFileL.READ(BigTextL) <> 0 THEN;
LinesL += 1;
END;
EXIT(LinesL);I have used InStreams and OutStreams and all the functions available for BigText
without success: I could not read the BigTextL variable, can anyone help please?:
IF WorkFileL.READ(BigTextL) <> 0 THEN REPEAT
//BigTextL.ADDTEXT(BigTextL);
TempItemRecL.INIT;
TempItemRecL."No.":='test_test';
TempItemRecL.Picture.CREATEOUTSTREAM(OstreamL);
BigTextL.WRITE(OstreamL);
TempItemRecL.INSERT;
TempItemRecL.GET('test_test');
TempItemRecL.CALCFIELDS(Picture);
IF TempItemRecL.Picture.HASVALUE THEN BEGIN
ItemRecL.Picture.CREATEINSTREAM(IstreamL);
BigTextL.READ(IstreamL);
WHILE NOT (IstreamL.EOS()) DO
BEGIN
IstreamL.READTEXT(WorkTextLineL);
END;
END;
TempItemRecL.DELETE;
//BigTextL.GETSUBTEXT(WorkTextLineL, 1, 1024);
CLEAR(BigTextL);
IF STRLEN(WorkTextLineL)>0 THEN BEGIN
... ...
//WorkTextLineL is a String so any String function I can use now
// but I am getting WorkTextLineL='';
... ...
END;
Comments
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
may be i could not clearly state my problem...
i could count the lines
i could load each line of the .txt file in the BigText variable
but I could not use it ...
I need to grab the first 1024 character of the BigText variable
for various String manipulation
which I could not do...
tried all the available functions of BigText - without success
thanks again
IF First1024Chars = '', it is possible that you only had blanks in the first 1024 positions.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!