Highlighted
Absent Member.
Absent Member.
1217 views

Predicate

Hello,

could anyone help me ? I have collections of some items, each of them has unique ID and I need to write code to find the item of specific ID. I found class Predicate and I suppose that this could be the right way to solve it as simple as possible. But may be I'm wrong I don't know.

I also tried to write some code according C# and C++ codes but I wasn't successful.

Thanks

0 Likes
3 Replies
Highlighted
Absent Member.
Absent Member.

RE: Predicate

Can you be more specific? The problem you are describing has actually a very simple solution with indexed files.

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

RE: Predicate

Did you consider to use a dictionary?

01 myDictionary[binary-long, type Object]. *> 1st parameter is type of key.

create myDictionary

perform ....

  ...  *> set values for myObject and dicKey

  write myDictionary from myObject key dicKey

end-perform

To get a item:

*> set value for dicKey

read myDictionary into myObject key dicKey invalid key ...

end-read.

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Predicate

Well, I have collection of menuitems with property Name and I'm looking for as quick way of retrieving requested item according to its name as possible. And I thought using Predicate would be the best way. I prefer when the code is as simple as possible, that's all.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.