Script Execution

Some languages such as Python parse script line by line. An error won't be captured until the line of code that contains it has been executed. If an error occurs, time is wasted executing the script before the error. In contrast, DolphinDB first parses a block of script for grammar checking. The parsing phase identifies errors such as undefined variables or missing function parameters, etc. The parsing phase also stores function definitions in memory for later use. After parsing, if there is no error, DolphinDB interprets the script line by line and executes the script.

There are 2 ways to execute script in a DolphinDB console. We can type multiple lines of script and then type semicolon (;) and hit "ENTER" to trigger the parsing and execution of the script, or we can save the script in a file and then execute the script file with the run command:

run "<script file>";