Just pass in the filename to a fn that takes the args you need:

1
Seq.iter (fun item -> insertData @"C:/xx" item) data

or, using currying:

1
Seq.iter (insertData @"C:/xx") data

Assuming I understand your question - though ISTM that you need the filename to get the data from the CSV, not for the update - but I'm not sure what your code does.

You may find an imperative solution more clear here:

for item in data do (insertData @"c:/xx" item)

By on 3/1/2011 10:10 AM ()

Ah, thank you very much. Just what I was looking for. I have a lot to learn. I had tried it that way, but didn't have it in parens. Not sure why I didn't think of that.

Thanks,
Nick

By on 3/1/2011 10:44 AM ()

Hmm, the parens are not strictly necessary - try from the interactive:

1
2
3
4
5
6
7
8
> let xxx a b = printfn "%A" a;;

> for i in [1;2;3] do xxx i i;;
1
2
3
val it : unit = ()
>
By on 3/1/2011 11:27 AM ()

Right you are, again. I'm not sure what I had goofed up the first time. It's working now and I have a reasonably good handle on it. Thank you very much for your help.

By on 3/3/2011 8:09 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