简体   繁体   中英

returning variables F#(canopy) easiest way

 member x.Logovani(window : string) =
            let weburl = ref ""   
            let actwindow = ref ""     

            "Login" &&& fun _ ->
                browser.SwitchTo().Window(window) |> ignore
                weburl := currentUrl()
                actwindow := browser.CurrentWindowHandle
                return {|weburl,actwindow|}
 end

Hello my question is how to pass weburl and actwindow easiest way, because the way of my return is not working. I want to call function Logovani pass to that function var window and then recieved weburl and actwindow

so finally i fixed it like this

 member x.Logovani(window : string) : string ref =
            let weburl = ref ""   
                browser.SwitchTo().Window(window) |> ignore
                weburl := currentUrl()
            weburl
 end

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM