【发布时间】:2018-02-10 11:05:21
【问题描述】:
当使用Inno Setup preprocessor 生成多行输出时,例如在我的这些答案中:
- Inno Setup - Recurse sub directories without creating those same sub directories
- Function to add multiple source lines to Inno File section
- Generating Inno Setup file flags programmatically
- Inno Setup: Dynamically add a component for all files in a folder and its subfolders
- Choose between source paths for all files
我总是必须使用#pragma parseroption directive 切换到C 风格的字符串文字,因为使用C 风格的字符串文字,我可以使用\n:
#pragma parseroption -p-
#define TwoLines "line1\nline2\n"
#pragma parseroption -p+
我还没有找到任何方法在默认的 Pascal 样式字符串文字中发出换行符。
在真正的 Pascal(脚本)字符串中,可以使用 #13#10。但这在预处理器中不起作用。两者都没有相当于 Pascal Chr function。
还有其他方法可以在 Pascal 风格的字符串文字中发出新行吗?
【问题讨论】:
-
你的意思是像这样的 const 字符串文字:
const myString = 'this is a long string that extends' + 'to a second line';? -
@DeadTrousers 不,预处理器文字。喜欢
#define FileEntry(Source) "Source: " + Source + "; DestDir: {app}\n"。在链接的问题中查看更多示例。
标签: inno-setup