S
shapper
Hello,
I created a Structure as follows:
' Pair
Public Structure Pair
' -- [Properties] ----
' Expression
Private _Expression As String
Public Property Expression() As String
Get
Return _Expression
End Get
Set(ByVal Expression As String)
_Expression = Expression
End Set
End Property ' Expression
' Regex
Private _Regex As RegularExpression
Public Property Regex() As RegularExpression
Get
Return _Regex
End Get
Set(ByVal Regex As RegularExpression)
_Regex = Regex
End Set
End Property ' Regex
' Valid
Private _Valid As Boolean
Public Property Valid() As Boolean
Get
Return _Valid
End Get
Set(ByVal Regex As Boolean)
_Regex = Regex
End Set
End Property ' Valid
' -- [Methods] ----
' New
Public Sub New(ByVal Expression As String, ByVal Regex As
RegularExpression)
' Define property values
Me.Expression = Expression
Me.Regex = Regex
Me.Valid = Valid
End Sub ' New
End Structure ' Pair
Then I have a function:
Public Overloads Shared Function Match(ByRef pairs As
Generic.List(Of Pair)) As Boolean
For Each pair As Pair In Pairs
End Function
I am using this function as follows:
Dim pairs As New Generic.List(Of Validation.Pair)
With pairs
'.Add(New Validation.Pair(tbCity.Text,
Validation.RegularExpression.NotEmpty, False))
'.Add(New Validation.Pair(tbEmail.Text,
Validation.RegularExpression.NotEmpty, False))
End With
Dim result As Boolean = Match(pairs)
This is not working and when I added a Watch, as I mention in this
post, I get:
pair {Pair} Pair
_Expression "Hello" String
_Regex 0
RegularExpression
_Valid False Boolean
Expression "Hello" String
Regex 0
RegularExpression
Valid False Boolean
What I see by my many tryings is that the value I define as expression
works fine.
However. the values of Regex and Valid are always 0 and False whatever
I define them.
I tried everything I could think of. But I have no idea what else to
do.
Thanks,
Miguel
I created a Structure as follows:
' Pair
Public Structure Pair
' -- [Properties] ----
' Expression
Private _Expression As String
Public Property Expression() As String
Get
Return _Expression
End Get
Set(ByVal Expression As String)
_Expression = Expression
End Set
End Property ' Expression
' Regex
Private _Regex As RegularExpression
Public Property Regex() As RegularExpression
Get
Return _Regex
End Get
Set(ByVal Regex As RegularExpression)
_Regex = Regex
End Set
End Property ' Regex
' Valid
Private _Valid As Boolean
Public Property Valid() As Boolean
Get
Return _Valid
End Get
Set(ByVal Regex As Boolean)
_Regex = Regex
End Set
End Property ' Valid
' -- [Methods] ----
' New
Public Sub New(ByVal Expression As String, ByVal Regex As
RegularExpression)
' Define property values
Me.Expression = Expression
Me.Regex = Regex
Me.Valid = Valid
End Sub ' New
End Structure ' Pair
Then I have a function:
Public Overloads Shared Function Match(ByRef pairs As
Generic.List(Of Pair)) As Boolean
For Each pair As Pair In Pairs
Next pair> Added a Debug Watch HERE <
End Function
I am using this function as follows:
Dim pairs As New Generic.List(Of Validation.Pair)
With pairs
'.Add(New Validation.Pair(tbCity.Text,
Validation.RegularExpression.NotEmpty, False))
'.Add(New Validation.Pair(tbEmail.Text,
Validation.RegularExpression.NotEmpty, False))
End With
Dim result As Boolean = Match(pairs)
This is not working and when I added a Watch, as I mention in this
post, I get:
pair {Pair} Pair
_Expression "Hello" String
_Regex 0
RegularExpression
_Valid False Boolean
Expression "Hello" String
Regex 0
RegularExpression
Valid False Boolean
What I see by my many tryings is that the value I define as expression
works fine.
However. the values of Regex and Valid are always 0 and False whatever
I define them.
I tried everything I could think of. But I have no idea what else to
do.
Thanks,
Miguel