『楼 主』:
多行回退-QQ:309254515 趣味东
说明:一个TAB加N个回退符就能退行,8N+1列不能退行,
每行写满会自动换行,好象就是这个原因
借鉴一下楼下以前也有过此想法苦于找细节倒迷失方向了!论坛确实把TAB屏掉了!自己改吧!
@echo off&setlocal enabledelayedexpansion
title 多行回退-QQ:309254515 趣味东
for /f "tokens=2" %%i in ('mode con^|findstr 列') do (
set/a"1/(%%i%%8-1)"2>nul||(set/a col=%%i+1
mode con cols=!col!!8N+1列不能退行必需排除!)
)
for /l %%a in (1,1,1000) do set "ht=!ht!"
set tab=TAB键!论坛屏掉自己改吧!
:重列
echo %2|findstr "^[0-9]*$">nul&&set h=%2||set h=20
for /l %%a in (1 1 !h!) do echo.
echo,!tab!--总!h!行-- 格式:数字续退行(字母 总行数)
:next
set/p n=
call:退行 !n!
goto next
:退行
echo %1|findstr "^[0-9]*$">nul||set b=&&cls&&call:重列 qwd %2
echo,!tab!!ht! 2>nul
set/p=<nul
set/a b+=%1
for /l %%a in (!h! -1 !b!) do echo.
goto:eof
::版权所有 趣味东::
@echo off&title 多行回退-QQ:309254515 趣味东
SETLOCAL EnableDelayedExpansion&MODE CON LINES=50
for /f "tokens=2" %%i in ('mode con^|findstr 列') do set/a col=%%i
set/a"1/(COL%%8-1)"2>nul||set/a col+=1!(8N+1列不能退行,排除)!
set/a TAB="(col-1)/8+1"
:TH
for /l %%i in (30 -1 2) do echo,%%i:
set/p=1:<nul
:tl
set/p TH= 数字退行,字母重列 TH=
call:TAB !TH!
:TAB
echo %1|findstr "^[0-9]*$">nul||cls&&goto TH
set/a tn=TAB*(2+%1)
title !col!列 !tn!-TAB 退%1行
for /l %%i in (1 1 !tn!) do set ht=!ht!
echo= !ht!<nul
set ht=
goto tl
说明:一个TAB加N个回退符就能退行,就是有点不好控制!
以下测试的另一个:
@echo off&SETLOCAL EnableDelayedExpansion
set title=多行回退-QQ:309254515 趣味东
for /f "tokens=2" %%i in ('mode con^|findstr 列') do set/a col=%%i
set col=45
:col 扩展列(8N+1列不能退行,排除!)
set/a"1/(COL%%8-1)"2>nul||set/a col+=1
mode con COLS=!col!
::计算行内TAB数
set/a th="(col-1)/8+1"
echo !th!-TAB !col!列&title !th!-TAB !col!列 !title!
set/p=&cls
::列表正反位
for /l %%j in (1 1 !col!) do (set/a №=%%j%%10
if !№!==0 (set sn=!sn!*&set ds=*!ds!
) else (
set sn=!sn!!№!
set ds=!№!!ds!
) )
set a=0
:lin 增加行示例
set/aa+=1
echo;!sn:~,-1!!满行自动换行,少一字符吧!
for /l %%i in (1 1 !a!) do echo,!ds:~,-1!
call:ht
:: 增加列 继续示例
cls
if !a!==5 (set sn=&set ds=&set/a col+=1&goto col) else goto lin
:ht 调用退行 (真不好控制啊!待改进吧!)
set/a tn=th*a+2
title !col!列 !tn!-TAB 退!a!行 !title!
for /l %%i in (1 1 !tn!) do set ht=!ht!
set/p= !ht! ★!col!列 !tn!-TAB 退!a!行 ★始写内容:
set ht=
goto:eof [ Last edited by qwd on 2010-2-7 at 08:39 ]
|