InstallShield 2018 » InstallScript Language Reference
The FileInsertLine function inserts or replaces a line using line numbers. You can use FileInsertLine with FileGrep, which finds lines and returns their line numbers.
FileInsertLine works on line-oriented text files with lines that are no longer than 1,024 bytes. With InstallShield, a line longer than the maximum allowed length indicates a binary file and causes FileInsertLine to fail.
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 FileInsertLine.
Syntax
FileInsertLine (szFileName, szInsertLine, nLineNumber, nInsertFlag);
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 value of szInsertLine is inserted into that file if it exists. |
||||||||||||
szInsertLine |
Specifies the string to insert into the file. |
||||||||||||
nLineNumber |
Specifies the line number at which you want to insert szInsertLine. The first line number is 0. |
||||||||||||
nInsertFlag |
Specifies an insertion location option. Pass one of the following predefined constants in this parameter:
|
Return Values
Return Value |
Description |
||||||||||||||||||
0 |
FileInsertLine successfully inserted the line into the specified file. |
||||||||||||||||||
< 0 |
FileInsertLine failed because of one of the following conditions:
|
See Also
InstallShield 2018 Help LibrarySeptember 2018 |
Copyright Information | Flexera |