Board logo

标题: [其他] 批处理制表函数:Tab [打印本页]

作者: HOPE2021    时间: 2021-10-5 13:23     标题: 批处理制表函数:Tab

在批处理内内嵌:
  1. :Tab <Width> <Height> <Width[Cell]> <Height[Cell]>
  2. Rem Width  - 以单元格为单位,绘制表格的宽
  3. Rem Height  - 以单元格为单位,绘制表格的高
  4. Rem Width[Cell]  - 单元格的宽
  5. Rem Height[Cell]  - 单元格的高
  6. for /l %%i in (1,1,%2) do (
  7. Set /p Str=+<nul
  8. for /l %%j in (1,1,%1) do (
  9. for /l %%x in (1,1,%3) do (
  10. Set /p Str=-<nul
  11. )
  12. Set /p Str=+<nul
  13. )
  14. Echo.
  15. for /l %%x in (1,1,%4) do (
  16. Set /p Str=^|<nul
  17. for /l %%j in (1,1,%1) do (
  18. for /l %%x in (1,1,%3) do (
  19. Set /p Str=# <nul
  20. )
  21. Set /p Str=^|<nul
  22. )
  23. Echo.
  24. )
  25. )
  26. Set /p Str=+<nul
  27. for /l %%j in (1,1,%1) do (
  28. for /l %%x in (1,1,%3) do (
  29. Set /p Str=-<nul
  30. )
  31. Set /p Str=+<nul
  32. )
  33. @Goto :Eof
复制代码
外部函数形式:
Tab.Bat
  1. @Echo Off
  2. @Goto :Tab
  3. :Tab <Width> <Height> <Width[Cell]> <Height[Cell]>
  4. Rem Width  - 以单元格为单位,绘制表格的宽
  5. Rem Height  - 以单元格为单位,绘制表格的高
  6. Rem Width[Cell]  - 单元格的宽
  7. Rem Height[Cell]  - 单元格的高
  8. for /l %%i in (1,1,%2) do (
  9. Set /p Str=+<nul
  10. for /l %%j in (1,1,%1) do (
  11. for /l %%x in (1,1,%3) do (
  12. Set /p Str=-<nul
  13. )
  14. Set /p Str=+<nul
  15. )
  16. Echo.
  17. for /l %%x in (1,1,%4) do (
  18. Set /p Str=^|<nul
  19. for /l %%j in (1,1,%1) do (
  20. for /l %%x in (1,1,%3) do (
  21. Set /p Str=# <nul
  22. )
  23. Set /p Str=^|<nul
  24. )
  25. Echo.
  26. )
  27. )
  28. Set /p Str=+<nul
  29. for /l %%j in (1,1,%1) do (
  30. for /l %%x in (1,1,%3) do (
  31. Set /p Str=-<nul
  32. )
  33. Set /p Str=+<nul
  34. )
  35. @Exit /b
复制代码
By Hope2021
谢谢
作者: cmd1152    时间: 2021-10-5 13:43

回复 1# HOPE2021


    其实 第三方命令行 有个工具,也是绘画的




欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2