标题: [其他] 批处理制表函数:Tab [打印本页]
作者: HOPE2021 时间: 2021-10-5 13:23 标题: 批处理制表函数:Tab
在批处理内内嵌:- :Tab <Width> <Height> <Width[Cell]> <Height[Cell]>
- Rem Width - 以单元格为单位,绘制表格的宽
- Rem Height - 以单元格为单位,绘制表格的高
- Rem Width[Cell] - 单元格的宽
- Rem Height[Cell] - 单元格的高
- for /l %%i in (1,1,%2) do (
- Set /p Str=+<nul
- for /l %%j in (1,1,%1) do (
- for /l %%x in (1,1,%3) do (
- Set /p Str=-<nul
- )
- Set /p Str=+<nul
- )
- Echo.
- for /l %%x in (1,1,%4) do (
- Set /p Str=^|<nul
- for /l %%j in (1,1,%1) do (
- for /l %%x in (1,1,%3) do (
- Set /p Str=# <nul
- )
- Set /p Str=^|<nul
- )
- Echo.
- )
- )
- Set /p Str=+<nul
- for /l %%j in (1,1,%1) do (
- for /l %%x in (1,1,%3) do (
- Set /p Str=-<nul
- )
- Set /p Str=+<nul
- )
- @Goto :Eof
复制代码
外部函数形式:
Tab.Bat- @Echo Off
- @Goto :Tab
- :Tab <Width> <Height> <Width[Cell]> <Height[Cell]>
- Rem Width - 以单元格为单位,绘制表格的宽
- Rem Height - 以单元格为单位,绘制表格的高
- Rem Width[Cell] - 单元格的宽
- Rem Height[Cell] - 单元格的高
- for /l %%i in (1,1,%2) do (
- Set /p Str=+<nul
- for /l %%j in (1,1,%1) do (
- for /l %%x in (1,1,%3) do (
- Set /p Str=-<nul
- )
- Set /p Str=+<nul
- )
- Echo.
- for /l %%x in (1,1,%4) do (
- Set /p Str=^|<nul
- for /l %%j in (1,1,%1) do (
- for /l %%x in (1,1,%3) do (
- Set /p Str=# <nul
- )
- Set /p Str=^|<nul
- )
- Echo.
- )
- )
- Set /p Str=+<nul
- for /l %%j in (1,1,%1) do (
- for /l %%x in (1,1,%3) do (
- Set /p Str=-<nul
- )
- Set /p Str=+<nul
- )
- @Exit /b
复制代码
By Hope2021
谢谢
作者: cmd1152 时间: 2021-10-5 13:43
回复 1# HOPE2021
其实 第三方命令行 有个工具,也是绘画的
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |