Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dear friends,
I am trying to write a class that will parse XML data. I have a property called TagName. Since there are many tags I wanted to index them. Even though in the syntax of Property Get statement an argument can be used when I attempt to use the following code I get an "Compile error: Can't assign to read-only property." error. Public Property Let TagName(ByVal intI As Integer) TagName(intI) = ParsedData(intI) End Property Any suggestions are appreciated Ömer Ayzan |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Ömer,
The TagName property is a single value, not an array. The way you have it defined (which I think is what you want) is that the desired array index is passed in and the single value from that array is returned. In that case it should work if modified as follows: Public Property Let TagName(ByVal intI As Integer) TagName = ParsedData(intI) End Property This assumes that ParsedData is a valid array and that intI is a valid index into that array. -- Rob Bovey, MCSE, MCSD, Excel MVP Application Professionals http://www.appspro.com/ * Please post all replies to this newsgroup * * I delete all unsolicited e-mail responses * "Ömer Ayzan" wrote in message ... Dear friends, I am trying to write a class that will parse XML data. I have a property called TagName. Since there are many tags I wanted to index them. Even though in the syntax of Property Get statement an argument can be used when I attempt to use the following code I get an "Compile error: Can't assign to read-only property." error. Public Property Let TagName(ByVal intI As Integer) TagName(intI) = ParsedData(intI) End Property Any suggestions are appreciated Ömer Ayzan |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Rob in my earlier question I mistakenly posted a property let procedure. It
would have been Property Get. "Rob Bovey" wrote in message ... Hi Ömer, The TagName property is a single value, not an array. The way you have it defined (which I think is what you want) is that the desired array index is passed in and the single value from that array is returned. In that case it should work if modified as follows: Public Property Let TagName(ByVal intI As Integer) TagName = ParsedData(intI) End Property This assumes that ParsedData is a valid array and that intI is a valid index into that array. -- Rob Bovey, MCSE, MCSD, Excel MVP Application Professionals http://www.appspro.com/ * Please post all replies to this newsgroup * * I delete all unsolicited e-mail responses * "Ömer Ayzan" wrote in message ... Dear friends, I am trying to write a class that will parse XML data. I have a property called TagName. Since there are many tags I wanted to index them. Even though in the syntax of Property Get statement an argument can be used when I attempt to use the following code I get an "Compile error: Can't assign to read-only property." error. Public Property Let TagName(ByVal intI As Integer) TagName(intI) = ParsedData(intI) End Property Any suggestions are appreciated Ömer Ayzan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
I Need An Argument | Excel Worksheet Functions | |||
Can I use the argument: - IF, AND, THEN, ElSE | New Users to Excel | |||
if argument? | Excel Discussion (Misc queries) | |||
One more Argument. | Excel Worksheet Functions | |||
IF THEN argument | Excel Discussion (Misc queries) |