Please tell me how I can pause the console window when running the program in F#.
open System
let myList = [0..9]
let myFunction =
for n in myList do
Console.WriteLine(n)
myFunction
I am guessing that you want the console to display the output after the program execution finishes.
You could put this line in the end of your snippet
Console.ReadKey() |> ignore
to 'pause' the console in that sense.
You may consider to wrap the pause function in compiler directives, since you probably don't want to have the same effect in release code.
(* your code here *)
#if DEBUG
System.Console.ReadKey(true) |> ignore
#endif
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With