![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
How can I loop through the IHTMLAttributeCollection in J#. In C#, I can do it as follows: IHTMLAttributeCollection myAttrColl = (IHTMLAttributeCollection) myNode. attributes; IHTMLDOMAttribute myAttr; foreach myAttr in myAttrColl { if (myAttr.specified) //do something } But in J#, there is no foreach loop. Using for loop, I tried the following: for (int i=0; i < MyAttrColl.get_length(); i++) { myAttr = (IHTMLDOMAttribute) oAttrColl.item(i); //now do something } But the syntax for item method is IHTMLDOMAttribute.item (ref Object name). Hence, I get an error saying: method IHTMLDOMAttribute.item(int i) not found. Can someone please help? Thanks, Bob |
#3
| |||
| |||
|
|
From: "Bruno Jouhier [MVP]" <bjouhier (AT) club-internet (DOT) fr References: <513801c489e8$c6eee720$a301280a (AT) phx (DOT) gbl Subject: Re: Looping through IHTMLAttributeCollection in J#. Date: Wed, 25 Aug 2004 18:56:45 +0200 Lines: 38 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Message-ID: <eqGHDSsiEHA.3664 (AT) TK2MSFTNGP12 (DOT) phx.gbl Newsgroups: microsoft.public.dotnet.vjsharp NNTP-Posting-Host: l06v-13-117.d2.club-internet.fr 62.34.190.117 Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFT NGP08.phx.gbl!TK2MSFTNGP12 |
|
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.vjsharp:6422 X-Tomcat-NG: microsoft.public.dotnet.vjsharp Did you try get_Item(i) ? Bruno. "Bob" <anonymous (AT) discussions (DOT) microsoft.com> a écrit dans le message de news: 513801c489e8$c6eee720$a301280a (AT) phx (DOT) gbl... How can I loop through the IHTMLAttributeCollection in J#. In C#, I can do it as follows: IHTMLAttributeCollection myAttrColl = (IHTMLAttributeCollection) myNode. attributes; IHTMLDOMAttribute myAttr; foreach myAttr in myAttrColl { if (myAttr.specified) //do something } But in J#, there is no foreach loop. Using for loop, I tried the following: for (int i=0; i < MyAttrColl.get_length(); i++) { myAttr = (IHTMLDOMAttribute) oAttrColl.item(i); //now do something } But the syntax for item method is IHTMLDOMAttribute.item (ref Object name). Hence, I get an error saying: method IHTMLDOMAttribute.item(int i) not found. Can someone please help? Thanks, Bob |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |