|
-
Aug 3rd, 2008, 11:59 PM
#1
Thread Starter
New Member
how to use arrays in VB property
Hi All,
i'm trying to read one text file , if the strings in text file matches to any of the type which is written in regular expression (which is in XML). i want to store all those in an array to print it later.
Here is the code:
ObjInvoice.Amount() = regEx.Replace(strStringToMatch, "$1$2$3$4$5")
in the class file i have taken the property as
Public Property Get Amount() As String
Amount() = mstrAmount()
End Property
Public Property Let Amount(ByVal strAmount() As String)
mstrAmount() = strAmount()
End Property
but it is giving error to me.
can you please help me out what might me the reason for the error.
and can you expalin how to use arays in the property.
Thanks&Regards,
B.
-
Aug 4th, 2008, 12:52 AM
#2
Re: how to use arrays in VB property
You have not defined Amount as a string array:
Public Property Get Amount() As String()
-
Aug 4th, 2008, 01:28 AM
#3
Thread Starter
New Member
Re: how to use arrays in VB property
Hi merri,
thank for your comments ,
i have modified my code to
Public Property Get Amount() As String
Amount() = mstrAmount()
End Property
Public Property Let Amount(ByVal strAmount As String)
ReDim mstrAmount(10)
mstrAmount(0) = strAmount
End Property
here its giving me type mismatch error ,
can you please suggest me how to do it.
-
Aug 4th, 2008, 02:44 AM
#4
Re: how to use arrays in VB property
Code:
Public Property Get Amount() As String()
Amount = mstrAmount
End Property
Public Property Let Amount(ByRef NewValue() As String)
mstrAmount = NewValue
End Property
-
Aug 4th, 2008, 03:59 AM
#5
Thread Starter
New Member
Re: how to use arrays in VB property
i am calling that property from
ObjInvoice.Amount() = regEx.Replace(strStringToMatch, "$1$2$3$4$5")
ITS GIVING ERROR :
TYPE MISMATCH:array or user defined type expected
can i have your chat id (if no problem),so that i can contact when i have code issues.
Thank you for the reply.
From,
B.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|