:sort
set num=%1
set str=%*
for %%i in (%*) do if !num! gtr %%i set num=%%i
set ret=%ret% %num%
if not "!str:%num%=!" == "" call :sort !str:%num%=!
goto :eof
--------------------------------------------------
1、set num=%1这一句为什么只是把%1的头一个数字传给num;
比如%numbers%为:12 23 24 23 25 23 20 10
但是set num=%1却变成12呢?
2、%*是什么意思
[ Last edited by namejm on 2006-10-19 at 00:57 ]作者: pcl83 时间: 2006-10-6 11:57 请问各位高手,%*的意思是不是和tokens=*里的*一样也是忽略空格啊?!作者: 3742668 时间: 2006-10-6 12:26
Quote:
:sort
set num=%1
set str=%*
echo %* & pause
for %%i in (%*) do if !num! gtr %%i set num=%%i
set ret=%ret% %num%
if not "!str:%num%=!" == "" call :sort !str:%num%=!
goto :eof