Splitting Command Lines |
Top Previous Next |
In some cases, particularly when calling external professional applications from a Pipeline Runner script or project, the command lines can get very long indeed. Whilst Pipeline Runner can easily handle such long command lines, people are not so lucky and having very long lines of text can make it very difficult for the user to read and edit those parts of scripts.
In order to make life easier for Pipeline Runner users, a special syntax is provided to allow you to split the lines however you like, to any depth. To do this, simply start the first line with an @ sign and end the last line with a semicolon.
Syntax
@[Split Line Command];
Both Split Command Tokens (the @ sign before the command and the semicolon after it) are compulsory. Any text in between the start and end tokens will be concatenated into a single command so any additional spaces or characters you enter will be included in the final command line. Similarly if you do not include any spaces at the split point then two words may become joined and that could potentially cause an error to be thrown if the command is not expecting that. The key thing to understand is that whatever you put inside the split command text lines will be replicated in the final output.
Handling Command Lines Containing Semicolons
If you have a command line which contains multiple path and file name pairs separated by semicolons, you may well wish to split the lines by file but leaving the semicolon at the end of the line would result in an error, and if you move it to the next line it would be treated as a comment leading to a different error. To resolve this problem you need to escape the semicolon by adding another semicolon to each split inside the command line that ends with a semicolon, and finish with a single semicolon at the end of the command line so that this:
Exec:"%%ExternalApp%%", ""%%ApplicationRoot%%\bin\Release\Lib1.dll;%%ApplicationRoot%%\bin\Release\Lib2.dll;%%ApplicationRoot%%\bin\Release\Lib3.dll""
becomes this:
@Exec:"%%ExternalApp%%", ""%%ApplicationRoot%%\bin\Release\Lib1.dll;; %%ApplicationRoot%%\bin\Release\Lib2.dll;; %%ApplicationRoot%%\bin\Release\Lib3.dll"";
Example:
The following example is somewhat contrived as the commands are comparatively short and this feature would normally be used with very long commands. However it clearly demonstrates splitting two types of command - a Var command and a Remark command - as well as a Script Section Heading:
[Setup] Var:GenerateReport,true @Var:ReportFileName, "C:\Programming\Test\Test Report.txt"; // Resulting command: Var:ReportFileName,"C:\Programming\Test\Test Report.txt"
@[Split Remark Section Heading]; // Resulting command: [Split Remark Section Heading] @Remark:This is the first part of the Remark and this is the second part of the Remark|BlankLineBeforeAndAfter; // Resulting command: Remark:This is the first part of the Remark and this is the second part of the Remark|BlankLineBeforeAndAfter
See Also: Escaped Strings Logical Operators Reserved Characters Reserved Strings |