create desktop from using F# (f# Tutorial 2 )

after first tutorial welcome again ,

Now before see the data types and other fundamental of f# , we run a simple from application which will clear us about the structure of this language . So ready to get fun!!

Those who come from c background they know the pain to create a simple from, cpp would think same, but c# developer who may be thinking creating from is a not a matter in c#, easy to write. But all of u now saw power of F#. Even c# or vb.net will feel clinch that a from could be create that easily.

but first from add reference add system.windows.froms in ur reference for vs10.

open System.Windows.Forms
let form = new Form (Visible=true)
form.Click.Add (fun _ -> printfn "click")
Application.Run form

Now a console application will be open and a from will appear in the screen if u click he from, the console application prints the text clicks.

in this way we can use all reference library for f#. here we use windows but other can also use easily.

Now just care fully look the data type before saw next tutorial

Basic Types and Literals
sbyte            = System.SByte            76y
byte             = System.Byte             76uy
int16            = System.Int16            76s
uint16           = System.UInt16           76us
int32            = System.Int32            76
uint32           = System.UInt32           76u
int64            = System.Int64            76L
uint64           = System.UInt64           76UL
string           = System.String           "abc", @"c:\etc"
single           = System.Single           3.14f
double           = System.Double           3.14, 3.2e5
char             = System.Char             '7'
nativeint        = System.IntPtr           76n
unativeint       = System.UIntPtr          76un
bool             = System.Boolean          true, false
unit             = FSharp.Core.Unit         ()
obj              = System.Object            box 5
exn              = System.Exception        new ArgumentException()
bigint           = FSharp.Math.BigInt      1024I * 1024I * 1024I * 1024I
Advertisements

About kishordgupta

A software developer
This entry was posted in F SHARP and tagged , , , , , , . Bookmark the permalink.

One Response to create desktop from using F# (f# Tutorial 2 )

  1. fadedreamz says:

    thanks kishordgupta it was a great help. was looking for it.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s