return values of occurrences
Author: dylan.huart@gmail.com (Dylan)
Good afternoon, I try to return different values of my database, Thus : in data base : num_folder : 001 001 002 003 name_pdf : pdf1 pdf2 pdf3 pdf4 the folder 001 contain pdf1 and pdf2 the folder 002 contain pdf3 and the folder 003 contain pdf4 Thus I try to return e.g. the pdf of the folder 001 clear/e "entity_of_pdf" NUM_FOLDER.entity_of_pdf/init = NUM_FOLDER NAME_PDF.entity_of_pdf/init = NAME_PDF retrieve/e "entity_of_pdf" $occ_num$ = 1 While ($occ_num$ > $curocc(NUM_FOLDER.entity_of_pdf)) setocc "CINOMPJ", $occ_num$ if($status <0) $occ_num$ = -1 EndIf if($occ_num$ != -1) Putitem $lst_pdf$,-1,NAME_PDF.entity_of_pdf $occ_num$ = $occ_num$ + 1 EndIf EndWhile But $occ_num$ is always more big than $curocc(NUM_FOLDER.entity_of_pdf) idea ?
4 Comments
Local Administrator
Great ! Many Thanks
Author: Dylan (dylan.huart@gmail.com)
Local Administrator
Hi Dylan, There is a simpler way of doing this. The statement putlistitems can fill a list with all values of a certain field from all occurrences: clear/e "entity_of_pdf" NUM_FOLDER.entity_of_pdf/init = NUM_FOLDER NAME_PDF.entity_of_pdf/init = NAME_PDF retrieve/e "entity_of_pdf" putlistitems/id $lst_pdf$, NAME_PDF.entity_of_pdf Good luck, Theo
Author: Theo Neeskens (tneeskens@itblockz.nl)
Local Administrator
Hi Theo and Thank you for your response ! I dont know use in totality Uniface, and putlistitems is very easy to use ! many Thanks ! In my list of pdf there is the sign "=" : $lst_pdf$ = "test2.pdf=·;test3.pdf=" It's normal ? Thanks, Dylan
Author: Dylan (dylan.huart@gmail.com)
Local Administrator
That happens when I do not test my own advice... I did not want that = sign in the list. Please change into: putlistitems $lst_pdf$, NAME_PDF.entity_of_pdf So just remove the /id option
Author: Theo Neeskens (tneeskens@itblockz.nl)