set var=value # You can use a hash to comment, unlike in regular batch files
# This is a comment
^# If you escape comments by doing that, they will NOT be treated as comments. defmacro macro_name
echo Hello world!
endmacro
# You can also optionally have arguments.
defmacro greet name
echo Hello %name%!
endmacro callmacro macro_name # The if statements are similar to regular Batch files.
# The difference here is that you use the scope ends at the `endif` statement.
if <condition>
# Do something
else
# Do something else
endif while <condition>
# Do something
endwhile for <something>
# Do something
endfor # Labels are used to mark a position in the script.
label label_name
# You can jump to a label using the `goto` command.
goto label_name
# You can also call them using the `call` command.
call label_name # As of 1.1.0, you can include libraries in Batch++.
_include <lib.bpp> # Library in PATH
_include "lib.bpp" # Library not in PATHAnything not mentioned to be part of the language syntax that is part of Batch syntax is supported.
- Macros should compile to repeating code, not subroutines.
- Writing regular Batch should be allowed. Do not throw an error on unrecognized commands, only on invalid syntax!
- Batch++ should compile to regular Batch.
- You should ONLY follow the standard. If your compiler implementation is incomplete or adds extra commands, you should specify in the associated documentation files that the user WILL see.