在Inno Setup预处理器中发出新行 [英] Emit new line in Inno Setup preprocessor

查看:56
本文介绍了在Inno Setup预处理器中发出新行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用 Inno Setup预处理器来生成多行输出时,例如在以下答案中我的:

When using Inno Setup preprocessor to generate a multi-line output, like for example in these answers of mine:

  • 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指令切换到C样式的字符串文字,因为有了C样式的字符串文字,我可以使用\n:

I always have to switch to the C-style string literals using #pragma parseroption directive, because with C-style string literals, I can use \n:

#pragma parseroption -p-

#define TwoLines "line1\nline2\n"

#pragma parseroption -p+


在默认的Pascal样式字符串文字中,我还没有找到任何方法来产生换行符.


I haven't found any way to emit a new-line character in the default Pascal-style string literals.

在真实的Pascal(脚本)字符串中,可以使用#13#10.但这在预处理器中不起作用. Pascal都没有等效的 Chr函数.

In a real Pascal (Script) string, one can use #13#10. But that does not work in the preprocessor. Neither there's an equivalent of Pascal Chr function.

还有其他方法可以在Pascal样式的字符串文字中生成新行吗?

Is there any other way to emit a new line in the Pascal-style string literals?

推荐答案

在Inno Setup 6中可用.

There's NewLine macro available in Inno Setup 6.

如果您使用的是Inno Setup的旧版本,则可以在自己的脚本中定义宏.定义为:

If you are on an older version of Inno Setup, you can define the macro in your own script. It's defined as:

#pragma parseroption -p-
#define NewLine "\n"
#pragma parseroption -p+

这篇关于在Inno Setup预处理器中发出新行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆