I am creating portable publication on USB and would like create/read/write using my own text file using scripts. I have gone through the section “How to read data from a text file”. I have following questions.
- Is there any way to check if the text file alreay exists ?What is the API for it?
- Can i change the path where the .licence and .pref files resides on the USB ?
Try TStringList instead. See http://www.delphibasics.co.uk/Article.asp?Name=Files (
Using TStringList to read and write text files)
I tried built in FileExists function and it works. Now i want to read the file line by line and i tried built in function ReadLn function. As per the Delphi reference it takes 2 arguments( file handle and string). However if i try that within the script, i get an error. Apperantly it accepts only file handle. So is there a way to read afile line by line ?
Thanks for the link. Will try it out.