Forum Discussion
Colin_McCrae
11 years agoCommunity Hero
Eh?
I presume "strPropVal1,strPropVal2,strPropVal3,strPropVal4" are all meant to be passed into the function?
And you've also hardcoded the properties available to search on, which is restrictive.
What you've posted will work, but it's using a bazooka to kill a fly. If your pages has a lot of objects, that function will be very inefficient as you're starting at the top level (Page) for every object.
What would make more sense would be to pass it a top level object and also the properties, and their values, that you want to search for. Then build and execute a command to search the child objects of the passed in object based on the parameters and the values. It might also be a good idea to pass in the depth you want it to search.
I presume "strPropVal1,strPropVal2,strPropVal3,strPropVal4" are all meant to be passed into the function?
And you've also hardcoded the properties available to search on, which is restrictive.
What you've posted will work, but it's using a bazooka to kill a fly. If your pages has a lot of objects, that function will be very inefficient as you're starting at the top level (Page) for every object.
What would make more sense would be to pass it a top level object and also the properties, and their values, that you want to search for. Then build and execute a command to search the child objects of the passed in object based on the parameters and the values. It might also be a good idea to pass in the depth you want it to search.
Related Content
- 5 months ago
- 14 years ago
Recent Discussions
- 4 days ago
- 4 days ago
- 7 days ago