Results 1 to 2 of 2

Thread: Global Parameter

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2000
    Location
    Mesa, AZ, USA
    Posts
    16
    Ok...Ive narrowed down my problem. This may be simple but I am unsure of how to do this. How do I make a parameter in a function be seen in another function?

    Example:

    Public Sub WebBrowser1_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)


    I need to be able to use the URL parameter in this function:

    Public Sub NewWindow2(ppDisp as Object, Cancel as Boolean)


    Do I set a global variable and assign the url to it and then pass it into the NewWindow2 Event???

    If anyone has any ideas....I'd appreciate it.


    Thanks


    Dubi

  2. #2
    Lively Member
    Join Date
    Aug 1999
    Posts
    89
    To your question, the easiest way will be to put a global variable as you have said. Another way is to put both the sub in the same module and and declare a global variable on top of the module. I'm assuming that this 2 functions will be used in the same project. If you are using class, this would be a little bit complex. If you are using class, it'll be advisable to pass the value in form of property. Mail me if you have any questions. Hope this is what you want??

    Public myURL

    Public Sub WebBrowser1_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
    myURL=URL
    end sub

    Public Sub NewWindow2(ppDisp as Object, Cancel as Boolean)
    dim URL
    URL=myURL
    end sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width