PDA

Click to See Complete Forum and Search --> : Global Parameter


Dubi
Apr 20th, 2000, 11:33 PM
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

lychew
Apr 25th, 2000, 09:04 AM
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