Return from Subroutine

Returns to the scope above during the execution of a subroutine.

Syntax

return

Example

After the end of the instructions of a subroutine, the command returns the execution of the script to the scope above.

defVar --name file_path --type String
defVar --name text --type TextFileReader
defVar --name converted_text --type String
logMessage --message "Start of execution in the main method." --type "Info"
goSub --label readFile
logMessage --message "End of execution in the main method." --type "Info"
beginSub --name readFile
	logMessage --message "Executed subroutine" --type "Info"
	return
endSub

Limitations

If the Return from Subroutine command is added to the main method, the execution of the script is terminated.