Setting an object from a

Results 1 to 2 of 2

Thread: Setting an object from a

  1. #1
    Join Date
    Dec 1969

    Default Setting an object from a

    I have this within my displayxml sub to count the number of items. but it gives me an object not defined error when I try to write it within the page. What gives...<BR><BR>Set objLst = objXML.getElementsByTagName("item")<BR> intNoOfHeadlines = objLst.length -1<BR><BR>%&#062;<BR> <BR> For i = 0 To (intNoOfHeadlines)<BR><BR> Set objHdl = objLst.item(i)<BR> Response.Write("&#060;a href=""" & objHdl.childNodes(1).childNodes(0).text & """&#062;" & objHdl.childNodes(0).text & _<BR> "&#060;/A&#062;&#060;P&#062;") <BR> Next<BR>

  2. #2
    Join Date
    Dec 1969

    Default A guess...

    Are you saying that you have *this* line *INSIDE* a SUB or FUNCTION?<BR><BR>Set objLst = objXML.getElementsByTagName("item")<BR><BR>And then you try to use that object *OUTSIDE* the Sub or Function?<BR><BR>If so, where do you do the <BR><BR>DIM objLst<BR><BR>???<BR><BR>If you don&#039;t do it any place, or if you do it inside the Sub/Function, then the reference *does not exist* any place but inside the Sub/Function.<BR><BR>Look up "variable scope" in most any reference work.<BR><BR>And put a DIM at global page level and before the Sub/Function.<BR><BR>

Posting Permissions

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