Inline Languages
Both JavaScript and Python can be run inline within GarmScript. To run JavaScript inline use the function "jsrun" which will run all code on the same line as it as JavaScript. To run Python inline use the function "pyrun" which will run all code after it with the \ character at the end as Python code. For example:
pyrun \
print("Hello World") \
print("This is a test for GarmScript") \
Functions
Along with this, python functions can be defined like this:
pyrun \
def testfunc(num): \
for r in range(num): \
print("Hello World") \
print("This is a test for GarmScript") \
Then these functions can be called with the "callpyfunc" function. Using this function, variables can be passed to the python function like so:
% Define the variable to store the result of the function to.
setvar returned ""
setvar numberoftimes 3
% Call the function with the variable "numberoftimes" as a argument.
callpyfunc testfunc($numberoftimes) returned