Wednesday, August 01, 2012 12:01 AM
how to run this code in VS F# Interactive?
when i send it to F# interactive using Alt+Enter no things happened.
open System let mutable names : string = Array.empty let mutable continue1 = true while continue1 do Array.Resize(&names,names.Length + 1) printf "Please enter name %d: " names.Length let name = Console.ReadLine() names.[names.Length - 1] <- name printf "do you want to get more names?(y or n)" let answer = Console.ReadLine() if answer <> "y" then continue1 <- false printfn "\nArray Elements: %A" names printfn ""
Wednesday, August 01, 2012 6:21 AM
<del>You need to tell FSI that you've finished this code fragment by typing two semicolons and then hitting Return.</del>
<del>It works quite happily when you do that.</del>My bad , not reading the question in detail, but just pasting the code into the F# interactive console I always have open when reading the forum.
Wednesday, August 01, 2012 10:53 AM
You don't need to terminate with ";;" when using Alt-Enter from Visual Studio.
I think it is the use of ReadLine(), see http://stackoverflow.com/questions/8022512/how-to-read-user-input-using-f-interactive-in-visual-studio
Wednesday, August 01, 2012 7:56 PM
this problem is exist in new version of VS (2012 RC) still.
is a better graphical UI for F# interactive?
- Edited by Rainmater Thursday, August 02, 2012 8:56 PM