The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

DaFonseca (2) [Avatar] Offline
#1
I am using VS2012 and running page 93 code :
let rnd = new Random() in
let randomBrush() =
let r,g,b = rnd.Next(256), rnd.Next(256), rnd.Next(256)
new SolidBrush(Color.FromArgb (r,g,b)) ;;
But then I get this error message
Script.fsx(37,3): error FS0588: Block following this 'let' is unfinished. Expect an expression.

So I ve included : in randomBrush() at the end to finish the let as I would do in Ocaml. Does it mean I am using F# on Ocaml module? How can I run F# to get the book's example code running 100% fine?


let rnd = new Random() in
let randomBrush() =
let r,g,b = rnd.Next(256), rnd.Next(256), rnd.Next(256)
new SolidBrush(Color.FromArgb (r,g,b)) in randomBrush();;