search in struct
Author: yves.de.montmollin@aonhewitt.com (yves2m)
Hello, My question is very basic. But I can't find the answer ... I know I've seen this before ... but where ... I've a struct : vStruct->$dbgString
[] [paramsOut] [requestResult] [endOfCollection] = F [firstRowInCollection] = 5 [lastRowInCollection] = 10 [requestStatus] = 0 [collection] [OCC] [PE_ASSU_ID] = "350288" [NOM_ESTE_1] = 437 [PE_PERS_ID] = "329400" [DADVAL] = 20130823 [NPERSO] = "555891686" [LPNPER_UPPER] = "ALEXIS" [ROWNUM] = 5 [OCC] [PE_ASSU_ID] = "348649" [NOM_ESTE_1] = 425 [DADVAL] = 20140701 [PE_PERS_ID] = "329403" [NPERSO] = "555891642" [LPNPER_UPPER] = "ARNOLD" [ROWNUM] = 6 [OCC] [PE_ASSU_ID] = "348660" [NOM_ESTE_1] = 444 [DADVAL] = 20140715 [PE_PERS_ID] = "329732" [NPERSO] = "555891689" [LPNPER_UPPER] = "BERNARD" [ROWNUM] = 7 [OCC] [PE_ASSU_ID] = "349399" [NOM_ESTE_1] = 350 [DADVAL] = 20141231 [PE_PERS_ID] = "330038" [NPERSO] = "555892227" [LPNPER_UPPER] = "VIVIANE" [ROWNUM] = 8 [OCC] [PE_ASSU_ID] = "349466" [NOM_ESTE_1] = 730 [PE_PERS_ID] = "330078" [NPERSO] = "555892253" [LPNPER_UPPER] = "CASTULE" [ROWNUM] = 9 [OCC] [PE_ASSU_ID] = "349286" [NOM_ESTE_1] = 257 [PE_PERS_ID] = "329955" [NPERSO] = "555892179" [LPNPER_UPPER] = "ERNESTINE" [ROWNUM] = 10
How can I get the occ for NPERSO = "55589227" ? I don't want to go through all the collection with a loop ... (while / for) Thanks for your help Yves
3 Comments
Local Administrator
Hello Yves, I don't think that there currently is another way then to loop through all the OCC nodes; e.g.
vSearch = vStruct->paramsOut->collection->OCC ; vSearch => Struct vCollSize = vStruct->paramsOut->collection->OCC->$collsize ; vCollSize => Numeric for i = 1 to vCollSize if (vSearch{i}->NPERSO = "55589227") message/info "Found value in OCC{%%i}" break endif endfor Hope this helps. Kind regards, Daniel Iseli Uniface Technical Support
Author: diseli (daniel.iseli@uniface.com)
Local Administrator
Hi Yves / Daniel, How about something like this;
Your occurence sits in vs_buff.... Regards, Knut
Author: Knut (knut.dybendahl@gmail.com)
Local Administrator
Hi Folks, I got this solution, to be able to find not only the NPERSO but any tag name
I'll try to get something more generic. But this is already a solution without loop
Have a nice week-end Yves
Author: yves2m (yves.de.montmollin@aonhewitt.com)