InstallShield 2018 » InstallScript Language Reference
The FileDeleteLine function deletes a range of lines (including the starting line and ending line) from a text file using a starting and ending line number. This function works on line-oriented text files—it does not work with binary files. You can use FileDeleteLine with the FileGrep function to search and delete text lines in a file.
Caution • The file specified by szFileName must not already have been opened by a call to OpenFile. If szFileName is already open, call CloseFile before calling FileDeleteLine.
Syntax
FileDeleteLine ( szFileName, nStartLineNum, nEndLineNum );
Parameters
Parameter |
Description |
szFileName |
Specifies the unqualified name of a file located in the directory specified by the system variable SRCDIR, or the fully qualified path to the file. The lines specified by nStartLineNum and nEndLineNum will be deleted from that file if it exists. |
nStartLineNum |
Specifies the number of the first line to delete from the file. Note that line numbering begins at 0. |
nEndLineNum |
Specifies the number of the last line to delete from the file. Note that line numbering begins at 0. To delete from the line specified by nStartLineNum to the end of the file, pass the predefined constant DELETE_EOF in this parameter. |
Return Values
Return Value |
Description |
|||||||||||||||
0 |
FileDeleteLine successfully deleted the specified lines from the file. |
|||||||||||||||
< 0 |
FileDeleteLine failed because of one of the following conditions:
|
See Also
InstallShield 2018 Help LibrarySeptember 2018 |
Copyright Information | Flexera |