Sorry I haven't posted in a while. To borrow Harold Macmillan’s immortal line:
Anyways, here’s a little something I’ve been working on:Events, my dear boy, events.
Code: Select all
@echo off & setLocal enableExtensions disableDelayedExpansion
(call;) %= sets errorlevel to 0 =%
set ^"toggled=AaAaBbBbCcCcDdDdEeEeFfFfGgGgHhHhIiIiJjJjKkKkLlLlMmMm^
NnNnOoOoPpPpQqQqRrRrSsSsTtTtUuUuVvVvWwWwXxXxYyYyZzZz"
set "targetChr="
call :toggleCase w targetChr
set targetChr
goto end
:die
echo(unexpected end of program
(call) %= sets errorlevel to 1 =%
:end
endLocal & goto :EOF
:toggleCase
setLocal
for /f "delims=%1 tokens=2" %%A in ("#%toggled%") do (
endLocal & set "%2=%%A"
) %= for /f =%
exit /b 0 %= toggleCase =%
Next, I hope to extend :toggleCase to process whole strings. But I'm so busy these days, you may be waiting a while!
Happy Holidays!
- SB