![]() |
|
[Shell] Using SETLOCAL and ENDLOCAL inside functions - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Shell] Using SETLOCAL and ENDLOCAL inside functions (/showthread.php?tid=5462778) |
Using SETLOCAL and ENDLOCAL inside functions - ɩᴄᴀʀᴜȿ ᴌוᴠᴇѕ™ - Nov 13, 2016 Code @echo offThe code above demonstrates two functions being called inside the :main function. The purpose of this quick tutorial is to demonstrate how setlocal can be useful when used in functions that display output, and keep your variable environment pool small. Creating scripts that have A LOT of variables will run slower than a script with less variables. This is good to know for development in batch games where there could be MANY variables. Step by step in plain english.
This concludes my quick tutorial. If you have any questions feel free to ask! * - Sajuuk - Nov 13, 2016 You guys here have advanced so much since my last relative post in this section. Good to see that flawless tutorials with the code/explanation format are still being posted focusing on everything but the stereotypical Batch viruses. Awesome work. * - JoshuTee - Nov 13, 2016 (Nov 13, 2016 01:53 PM)Sajuuk Wrote: You guys here have advanced so much since my last relative post in this section. Good to see that flawless tutorials with the code/explanation format are still being posted focusing on everything but the stereotypical Batch viruses. Awesome work. I agree. Good work @OP! |