Greetings
I have written a series of classes (Rules, Rule, Condition, Conditions, CstrList) that allow me to do the following. The 'Rules' and 'Conditions' classes are based on collections. 'CstrList' is based on a dynamic string array. The structure is such that I can say
ParamOfFirstRuleFirstCondition = _
Rules(1).Condition(1).Param(0)
Now the problem. I would like to be able to have access using the 'For Each Next' method. Everything works great until I get to 'Param' where I get an 'Object doesn't support this property or method' error. I could use a collection instead of a string array for Param but this seem like a waist. How can i enum Param? Thx!
Dim rl As Rules
Dim r As Rule
Dim c As Condition
Dim p As CStrList
Set rl = New Rules
Set r = rl.Add("NEW RULE 1", "ANY"
Set c = r.Condition.Add("Condition 1-1", _
"contains", "and"
c.Param.Add "param #1"
c.Param.Add "param #2"
c.Param.Add "param #3"
For Each r In rl
Debug.Print r.Desc & "..."
For Each c In r.Condition
Debug.Print c.Noun & "..."
For Each p In c.Param ''' ERROR HERE!!!
Debug.Print p.Param
Next
Next
Next
I have written a series of classes (Rules, Rule, Condition, Conditions, CstrList) that allow me to do the following. The 'Rules' and 'Conditions' classes are based on collections. 'CstrList' is based on a dynamic string array. The structure is such that I can say
ParamOfFirstRuleFirstCondition = _
Rules(1).Condition(1).Param(0)
Now the problem. I would like to be able to have access using the 'For Each Next' method. Everything works great until I get to 'Param' where I get an 'Object doesn't support this property or method' error. I could use a collection instead of a string array for Param but this seem like a waist. How can i enum Param? Thx!
Dim rl As Rules
Dim r As Rule
Dim c As Condition
Dim p As CStrList
Set rl = New Rules
Set r = rl.Add("NEW RULE 1", "ANY"
Set c = r.Condition.Add("Condition 1-1", _
"contains", "and"
c.Param.Add "param #1"
c.Param.Add "param #2"
c.Param.Add "param #3"
For Each r In rl
Debug.Print r.Desc & "..."
For Each c In r.Condition
Debug.Print c.Noun & "..."
For Each p In c.Param ''' ERROR HERE!!!
Debug.Print p.Param
Next
Next
Next