gpt4 book ai didi

math - 使用 Autohotkey 减去变量

转载 作者:行者123 更新时间:2023-12-03 23:18:07 25 4
gpt4 key购买 nike

我正在 Autohotkey 中构建一个宏,它要求我从变量中减去一个数字,如下所示:

screenWidth = 1280
MsgBox, screenWidth - 150

出于某种原因,无论何时出现带有消息的对话框,我得到的都是 screenWidth - 150,而不是 1130。我通过这种方法更接近了一步:

screenWidth = 1280
MsgBox, %screenWidth% - 150

对于上面的代码,我得到了1280 - 150,但仍然没有数学结果。

根据文档,像 Price * (1 - Discount/100) 这样简单的代码应该可以工作,假设同时定义了“Price”和“Discount”。

有人可以告诉我我做错了什么吗?

最佳答案

我的错误是,在 MsgBox 方法的文档中,有人告诉我在 MsgBox 的末尾添加百分号会导致它将输入视为表达式.所以现在可以正确计算 MsgBox % screenWidth - 150

关于math - 使用 Autohotkey 减去变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7855577/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com