Usage ListFunctions.bat batchfile.bat
Will list all functions found in that batch file, minus a pre-defined list of exclusions
Example
The exclusion are one of the following words, when the function name is tokenized, in the last position
As well as any function that starts with "EndOf_"
main setup end loop loop2 loop3 loop4 skip skip1 skip2 skip2 skip3 skip4 test test1 test2 test3 cleanup argument params args next prev iteration pre post 0 1 2 3 4 5 6 7 8 9 subloop matchfound nomatch found index list arguments preamble test4 test5 test6 start reset
You can specify a different set by adding it as a string when calling "Call :IsFunctionLabelExcluded"
ListFunctions.bat This list all "functions" in a .bat file
Moderator: DosItHelp
Re: ListFunctions.bat This list all "functions" in a .bat file
And now ListFunctionRows.bat
This new version lists every function and it's row number in the file.
The definition of a function here is,
At least one empty row before
A label
Either an "exit" or a label that starts with EndOf_ and then the label name
then another empty row
There is a minor bug with functions that have aliases or overload (that is, no space between) revised batchsample.bat
Next step will be a function which you specify a file and one or more functions, and an output file where all these functions will be copied too.
Also a function, which retrieves all functions called by a function.
The goal is to quickly create function library.
Or to populate a batch file with all the batch function dependencies it needs.
This new version lists every function and it's row number in the file.
The definition of a function here is,
At least one empty row before
A label
Either an "exit" or a label that starts with EndOf_ and then the label name
then another empty row
There is a minor bug with functions that have aliases or overload (that is, no space between) revised batchsample.bat
Next step will be a function which you specify a file and one or more functions, and an output file where all these functions will be copied too.
Also a function, which retrieves all functions called by a function.
The goal is to quickly create function library.
Or to populate a batch file with all the batch function dependencies it needs.
- Attachments
-
- cmd_ziBbvhPzta.png (204.92 KiB) Viewed 4355 times