Hi I am having a problem running a function to read a text file the problem seems to be that my antivirus blocks my delphi console program because when I do for a visual form there is no problem . Tengos two codes one is this :
This goes to perfection but do not want to use the component Classes for the program does not weigh much . Also I have this :
Other code.
This is the problem because when I use my antivirus deletes it at the time , my question to other alternatives I have to read a text file without using Classes. Someone can help me? |
|||
You can use win32 api. In one of my apps I do things like that, extend/modify to match your needs. This only use Win32 API and does not lock the file. It's like notepad. When you open a file with notepad it is not locked and can still be written or read by other software.
|
|||||||||||||||||||||
|
|
||||
This code works fine for me as a console application, Delphi 2007, running on Win7 64: Contents of 'E:TempFilesTest.txt':
Source:
Produces output:
|
|||||||||||||||||||||
|
If you don't want to use the Classes unit, only need to operate on this file, and are making a Windows executable, you could use the Windows unit instead and call the Win32 API functions: CreateFile, ReadFile, CloseHandle and related functions. |
https://stackoverflow.com/questions/19983202/read-text-files-in-delphi
finalarchivo : = + lineasleyendo finaldearchivo
is not valid Delphi syntax. If you want help with your code, post your real code. We can't debug code you make up as you go, because you could change the real problem while you're making it up. – Ken White Nov 14 '13 at 16:41TStringList
also from a console program! Classes and components / visual forms are two very different things. – jpfollenius Nov 14 '13 at 16:44