Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, Can someone please explain t

Status
Not open for further replies.

cat5ives

Programmer
Sep 13, 2011
11
US
Hi,

Can someone please explain to me what the statement in red does? Why the object ReadXML has the same name as funciton name? Thanks in advance.

Code:
function ReadXML (url)
    dim xmldoc    
    Set xmldoc = Server.CreateObject("MSXML2.DOMDocument")
    xmldoc.async = False
    xmldoc.setProperty "ServerHTTPRequest", true
    xmldoc.load (url)
    [COLOR=#A40000]set ReadXML = xmldoc[/color]
end function
 
javascript? this looks more like Visual Basic.
 
This is not Javascript. Its ASP.

In ASP to return a value from a function you set the function's name to the value.

for any more ASP questions I suggest posting in forum333 or even forum855


----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
More precisely, it's VBS. VBS returns a value by assigning the value to the function's name. However, [tt]set[/tt] is used to assign an object to a variable. Because [tt]xmldoc[/tt] is an object, set is used.

-Geates
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top