真正的批处理函数应用方法,高速的!
批处理编程将进入一个新的台阶。。。
目前只支持一个参数,欢迎大家加入讨论。。。
批处理编程将进入一个新的台阶。。。
目前只支持一个参数,欢迎大家加入讨论。。。
@echo off
::定义函数
set "d-h=setlocal enabledelayedexpansion&set/a dx=#a#&set xs=0123456789abcdef&(for /l %%z in (1,1,4) do set /a x%%z=dx%%16,dx=dx/16)&(for /f "tokens=1-4" %%1 in ("!x1! !x2! !x3! !x4!") do set hx=!xs:~%%4,1!!xs:~%%3,1!&(if !hx!==00 set hx=)&(for %%z in ("!hx!!xs:~%%2,1!!xs:~%%1,1!") do endlocal&set #a#=%%~z))"
::10进制转为16进制的函数,参数入口#a#
::注意要在开启变量延迟前定义
setlocal enabledelayedexpansion
for /l %%a in (1,7,1024) do (
set abc=%%a
(%d-h:#a#=abc%)
rem 函数调用
echo !abc!
)

