F# Interactive is a way of executing parts of a program interactively. Doing this enables you as a programmer to explore parts of the code and how it behaves. You will have a more dynamic feel for writing code. It's also more fun. F# Interactive is a REPL for F#. This means, it will read the code, evaluate it, and then print out the result. It will then do this over and over again. It's much like a command line, where the code is executed and the result is displayed to the user.
To execute a code in F# Interactive, have a look at the following steps:
Select the source code you are interested in and press Alt + Enter.
You can write a simple line of code that will just print a string to the REPL's output window:
printfn "Hello World, from F"
It's also possible to right-click on the selected code and choose Execute In Interactive.
When executing the code using the Interactive mode, the result is shown in the F# Interactive Evaluation window below the code editor. It is also possible, and sometimes preferable to enter snippets into the Interactive window like the following example illustrates.
Enter the following line in the F# Interactive window and press Enter:
printfn "Hello World, from F#";;
This will be evaluated to the following in the REPL:
> printfn "Hello World, from F#";; Hello World, from F# val it : unit = ()
Using double semicolons (;;) after the line will terminate the input and enable you to just hit the Enter key, they are required if you type directly into the terminal window.
If you want to cancel the evaluation, it's possible to right-click on and then select Cancel Interactive Evaluation, or simply press Ctrl + Break.