![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-10 12:07 |
47,811 topics / 349,897 posts / today 0 new / 48,255 members |
| DOS批处理 & 脚本技术(批处理室) » [Solved] About comparisons like LSS EQU in IF expansion. |
| Printable Version 2,438 / 16 |
| Floor1 picat | Posted 2007-05-01 03:05 |
| 初级用户 Posts 68 Credits 150 | |
|
if 20070323 LSS 20070423 @Echo good!!
Such a simple command, but it just doesn't output the "good!" character. I looked at the help, and string1 LSS string2 seems to only compare strings. Then, if I want to compare two numbers, how should I do it? I searched the forum, but there seems to be no post about this. Please ask the expert to help, thank you. [ Last edited by HAT on 2008-11-16 at 12:39 ] |
|
| Floor2 dikex | Posted 2007-05-01 03:20 |
| 高级用户 Posts 366 Credits 788 | |
|
That code can output good!! here for me.
|
|
| Floor3 picat | Posted 2007-05-01 03:24 |
| 初级用户 Posts 68 Credits 150 | |
|
Hey, strange. Running it alone is okay, but putting it in a bat file doesn't work.郁闷. Is there any expert to answer?
|
|
| Floor4 dikex | Posted 2007-05-01 03:31 |
| 高级用户 Posts 366 Credits 788 | |
|
I just saved it as a bat file and ran it...
|
|
| Floor5 picat | Posted 2007-05-01 03:31 |
| 初级用户 Posts 68 Credits 150 | |
|
It works under XP, but not under 2000. It's frustrating.
|
|
| Floor6 ansipeter | Posted 2007-05-01 03:39 |
| 中级用户 Posts 130 Credits 269 | |
|
Maybe 2000 is treating it as a date. Try replacing LSS with GTR. If it shows GOOD, it means it's handling it as a date. If there's an error, look for other reasons. I don't have 2000, so I can't test.
|
|
| Floor7 picat | Posted 2007-05-01 03:39 |
| 初级用户 Posts 68 Credits 150 | |
|
I made a mistake. The above statement is okay, but actually what I want to compare is like this:
if 20070323000000 LSS 20070423000000 @Echo good!! There are 6 zeros after the date format. It's a log generated by some software, in the format of date + 6 zeros, as above. At this time, it can't be compared in size. I have tested, it seems that it only supports up to 10 digits. Higher than that can't be compared... |
|
| Floor8 zhoushijay | Posted 2007-05-01 03:44 |
| 高级用户 Posts 375 Credits 845 | |
|
Such a large number is being processed by P and cannot be used for comparison or calculation, exceeding the range.
|
|
| Floor9 picat | Posted 2007-05-01 03:46 |
| 初级用户 Posts 68 Credits 150 | |
|
Well, I think so too. I made a wrong judgment at first, thinking it was a problem with LSS judgment. Thanks to everyone above.
|
|
| Floor10 everest79 | Posted 2007-05-01 03:46 |
| 金牌会员 Posts 1,127 Credits 2,564 | |
|
Can't you just remove those six zeros?
|
|
| Floor11 lxmxn | Posted 2007-05-01 04:40 |
| 版主 Posts 4,938 Credits 11,386 | |
|
The numerical range that batch processing can directly handle is -2147483648 to 2147483647.
[ Last edited by lxmxn on 2007-4-30 at 06:47 PM ] |
|
| Floor12 bjsh | Posted 2007-05-01 05:22 |
| 银牌会员 Posts 621 Credits 2,000 | |
|
Regarding large number processing, the p processing can still be solved; another way is needed; refer to:
http://www.cn-dos.net/forum/viewthread.php?tid=30215&fpage=1 http://www.cn-dos.net/forum/viewthread.php?tid=29097&fpage=1&highlight=%E5%9B%9B%E8%88%8D%E4%BA%94%E5%85%A5 Respectively, addition and division of large numbers are carried out, and the ideas for multiplication and subtraction are similar.. Study by yourself.. |
|
| Floor13 picat | Posted 2007-05-01 05:39 |
| 初级用户 Posts 68 Credits 150 | |
|
Wow, thank you, moderator. Just discovered this forum, didn't expect such quick replies~~
|
|
| Floor14 jashonx | Posted 2007-06-20 15:14 |
| 初级用户 Posts 21 Credits 44 | |
|
About the numerical comparison commands in batch processing, like lss, equ, etc. Can you give me a detailed explanation?
|
|
| Floor15 zh159 | Posted 2007-06-20 15:23 |
| 金牌会员 Posts 1,467 Credits 3,687 | |
Originally posted by jashonx at 2007-6-20 15:14: Check if /? |
|
| 1 2 Next |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |