我有一个包含哈希的应用程序版本。为了安装程序,我想要一个没有哈希的简单版本。我有以下代码,这些代码主要有用,有问题的部分是Delete
调用,根据documentation Deletes the specified number of characters beginning with Index from S. S is passed by reference (therefore is modified).
#define FullAppVersion "0.0.9 - abcdef012345"
#expr WriteIni("D:\\debug.txt", "Debug", "Full", FullAppVersion)
#define SimpleVersion FullAppVersion
#expr WriteIni("D:\\debug.txt", "Debug", "SimpleBefore", SimpleVersion)
#define HashPos Pos(' ', SimpleVersion)
#expr WriteIni("D:\\debug.txt", "Debug", "Pos", HashPos)
#expr Delete(SimpleVersion, HashPos)
#expr WriteIni("D:\\debug.txt", "Debug", "SimpleAfter", SimpleVersion)
但是,执行上述操作时,调试如下:
[Debug]
Full=0.0.9 - abcdef012345
SimpleBefore=0.0.9 - abcdef012345
Pos=6
SimpleAfter=0.0.90.0.9 - abcdef012345
Delete
似乎通过从指定位置进行修剪来部分工作,但是最后还会在结尾处连接整个字符串。
我做错了什么,或者功能上是否有故障?使用Inno Setup Compiler 5.5.5和Inno Script Studio 2.2.1.31