小于或等于 [英] Less than or equal to

查看:133
本文介绍了小于或等于的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用暂停命令,我发现该错误是在这个code的第一行:

Using the pause command I found that the error is in the first line of this code:

if %choice% == 1 if %energy% => %m2enc% set /a enemhp=%enemhp%-%m1hpd%+%earmr%
pause
set /a energy= %energy%-%m1enc%
set /a hp= %hp%-%edefense%
set /a defense= %defense%+1
goto battle

所以,不要说我忘了设定的能量和m2enc,因为我在不同的部分就是这样做的,我也试图与<替换%的能量% code> 10 和 m2enc% 1 ,它仍然没有工作中,我尝试更换 =&GT; &GT; = LSQ (显然是小于或等于太替代),所以我想知道什么是错误的这一部分。

So don't say that I forgot to set the energy and the m2enc, because I did just in a different section, I also tried replacing %energy% with 10 and m2enc% with 1 and it still didn't work, I tried replacing the => with >= and with LSQ (apparently an alternative for less than or equal too) So I would like to know whats wrong with this part.

推荐答案

在批次,&GT; 是用于输出数据到一个文本文件中的重定向符号。对于CMD比较运算的可用(推荐)如下(​​?从如果/ 帮助引用):

In batch, the > is a redirection sign used to output data into a text file. The compare op's available (And recommended) for cmd are below (quoted from the if /? help):

where compare-op may be one of:

    EQU - equal
    NEQ - not equal
    LSS - less than
    LEQ - less than or equal
    GTR - greater than
    GEQ - greater than or equal

这应该解释你想要什么。唯一的其他比较-op是 == 可与如果没有参数进行切换。其他然后,依靠这些三个字母的。

That should explain what you want. The only other compare-op is == which can be switched with the if not parameter. Other then that rely on these three letter ones.

这篇关于小于或等于的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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