China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-10 17:00
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Solved] About comparisons like LSS EQU in IF expansion. View 2,445 Replies 16
Original Poster Posted 2007-05-01 03:05 ·  中国 上海 电信张江机房
初级用户
★★
Credits 150
Posts 68
Joined 2007-04-26 00:18
19-year member
UID 86476
Gender Male
Status Offline
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 ]
Floor 2 Posted 2007-05-01 03:20 ·  中国 广东 广州 天河区 电信
高级用户
★★★
潜水修练批处理
Credits 788
Posts 366
Joined 2006-12-31 02:43
19-year member
UID 75048
Gender Male
Status Offline
That code can output good!! here for me.
Floor 3 Posted 2007-05-01 03:24 ·  中国 上海 电信张江机房
初级用户
★★
Credits 150
Posts 68
Joined 2007-04-26 00:18
19-year member
UID 86476
Gender Male
Status Offline
Hey, strange. Running it alone is okay, but putting it in a bat file doesn't work.郁闷. Is there any expert to answer?
Floor 4 Posted 2007-05-01 03:31 ·  中国 广东 广州 天河区 电信
高级用户
★★★
潜水修练批处理
Credits 788
Posts 366
Joined 2006-12-31 02:43
19-year member
UID 75048
Gender Male
Status Offline
I just saved it as a bat file and ran it...
Floor 5 Posted 2007-05-01 03:31 ·  中国 上海 电信张江机房
初级用户
★★
Credits 150
Posts 68
Joined 2007-04-26 00:18
19-year member
UID 86476
Gender Male
Status Offline
It works under XP, but not under 2000. It's frustrating.
Floor 6 Posted 2007-05-01 03:39 ·  中国 北京 联通
中级用户
★★
替身
Credits 269
Posts 130
Joined 2007-03-23 21:41
19-year member
UID 82683
Gender Female
Status Offline
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.
Floor 7 Posted 2007-05-01 03:39 ·  中国 上海 电信张江机房
初级用户
★★
Credits 150
Posts 68
Joined 2007-04-26 00:18
19-year member
UID 86476
Gender Male
Status Offline
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...
Floor 8 Posted 2007-05-01 03:44 ·  中国 新疆 乌鲁木齐 天山区 电信
高级用户
★★★
Autowalk
Credits 845
Posts 375
Joined 2007-03-03 01:58
19-year member
UID 80606
Gender Male
Status Offline
Such a large number is being processed by P and cannot be used for comparison or calculation, exceeding the range.
Floor 9 Posted 2007-05-01 03:46 ·  中国 上海 电信张江机房
初级用户
★★
Credits 150
Posts 68
Joined 2007-04-26 00:18
19-year member
UID 86476
Gender Male
Status Offline
Well, I think so too. I made a wrong judgment at first, thinking it was a problem with LSS judgment. Thanks to everyone above.
Floor 10 Posted 2007-05-01 03:46 ·  中国 广东 广州 天河区 电信
金牌会员
★★★★
一叶枝头,万树皆春
Credits 2,564
Posts 1,127
Joined 2006-12-25 22:57
19-year member
UID 74552
Gender Male
Status Offline
Can't you just remove those six zeros?
Floor 11 Posted 2007-05-01 04:40 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline
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 ]
Floor 12 Posted 2007-05-01 05:22 ·  中国 浙江 杭州 电信
银牌会员
★★★
Credits 2,000
Posts 621
Joined 2007-01-01 00:00
19-year member
UID 75212
Gender Male
Status Offline
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..
Floor 13 Posted 2007-05-01 05:39 ·  中国 上海 电信张江机房
初级用户
★★
Credits 150
Posts 68
Joined 2007-04-26 00:18
19-year member
UID 86476
Gender Male
Status Offline
Wow, thank you, moderator. Just discovered this forum, didn't expect such quick replies~~
Floor 14 Posted 2007-06-20 15:14 ·  中国 陕西 西安 电信
初级用户
铂金会员
Credits 44
Posts 21
Joined 2007-04-15 04:26
19-year member
UID 85218
Gender Male
Status Offline
About the numerical comparison commands in batch processing, like lss, equ, etc. Can you give me a detailed explanation?
Floor 15 Posted 2007-06-20 15:23 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
21-year member
UID 44210
Status Offline
Originally posted by jashonx at 2007-6-20 15:14:
About numerical comparison commands in batch processing, like lss, equ, etc. Can you tell me in detail?

Check if /?
Forum Jump: