Are you defining a value instead of a fn? E.g.:

let ZipCode = PanelName.Controls.[0].Text

should be:

let ZipCode() = PanelName.Controls.[0].Text

That would account for the value not changing.
Just an idea, if indeed your problem is F#-specific.

By on 3/24/2010 9:37 PM ()

Hi Another,

That changes the type of "ZipCode" from String to Unit. Doesn't look like it does the trick.

I'll just see if I can hack together some demonstration code to give a more definite question.

By on 3/25/2010 4:08 AM ()

The changes does not change the fn "from String to Unit" - the fn still returns a string - the () forces a fn which takes no arguments, and is the same as:

1
let ZipCode = fun -> Panel.Controls.[0].Text

Such as:

1
2
3
4
5
> let text() = "foo";;
val text : unit -> string

>printfn "%s" <| text() + text();;
foofoo

Anway, must be something else then...

By on 3/25/2010 7:31 AM ()

Thanks I've got it now although I'm not quite sure what it's about.

1.) You're right--have to add a () on the function def.

2.) Had to change the output type from Windows Application to Console Application. I need to look over the settings to figure out what this makes different.

I'm sharing this just in case anyone else runs into a similar issue.

By on 3/26/2010 9:01 PM ()

Yes--you're right; I didn't say it quite right. And you're right; without the (), it could simply be a string value and not a function returning a string.

I just need to hack together a small example--I have to believe I'm missing something pretty obvious because I don't believe I'm doing anything particularly out of the ordinary.

By on 3/25/2010 2:58 PM ()

Thanks, Another. That's a good suggestion. I'll give it a try. I am doing the former and I'll try the latter and see what I get.

By on 3/25/2010 2:58 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper