Startsidan  ▸  Texter  ▸  Teknikblogg

Anders Hesselbom

Programmerare, skeptiker, sekulärhumanist, antirasist.
Författare till bok om C64 och senbliven lantis.
Röstar pirat.

Using the framework from F#

2009-08-30

Just by typing the open statement, you can use the .NET Framework, or any other referenced libraries. To access the Console type, just add the following line to your source code:

open System

This program uses the built-in library function printfn, and then the WriteLine function to write “Hello world” to the screen.

printfn "Hello world"
open System
Console.WriteLine("Hello world")

So, displaying a message box, is just a matter of adding a reference to System.Windows.Forms, and this is how it could be done:

let x=System.Windows.Forms.MessageBox.Show("Hello world")

Or like so:

open System.Windows
let y=Forms.MessageBox.Show("Hello world")

Or even:

open System.Windows.Forms
let z=MessageBox.Show("Hello world")

Categories: Microsoft .NET

Tags: F#

Leave a Reply

Your email address will not be published. Required fields are marked *



En kopp kaffe!

Bjud mig på en kopp kaffe (20:-) som tack för bra innehåll!

Bjud på en kopp kaffe!

Om...

Kontaktuppgifter, med mera, finns här.

Följ mig

Twitter Instagram
GitHub RSS

Public Service

Folkbildning om public service.

Hem   |   linktr.ee/hesselbom   |   winsoft.se   |   80tal.se   |   Filmtips