[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: Question v11.7 Open Edge UI possibilities (automatic generated)

Status
Not open for further replies.
C

cjbree

Guest
filename: RELATE.P /************************************************************************/ /* relate.p -- to populate workfile "relate" with db relationships */ /* */ /* Input: */ /* shared workfile "relate" to describe database relationships */ /************************************************************************/ define shared workfile relate field owner like _file._file-name field mem like _file._file-name field idx like _index._index-name field numfld as integer format ">9" field matchlst as character format "x(80)" field dumpowner like _file._dump-name field dumpmem like _file._dump-name. define buffer xfld for _field. define buffer xfile for _file. define variable tnum as integer format ">9". define variable tmatch as character format "x(80)". define variable tdt like _field._data-type extent 10. define variable idx as integer. /*for each _index where _unique, each _file of _index where _file-number > 0:*/ for each _index where _unique, each _file of _index {_file2.i}: tnum = 0. for each _index-field of _index, _field of _index-field: tnum = tnum + 1. tmatch = if tnum = 1 then _field-name else tmatch + "," + _field-name. tdt[tnum] = _Data-Type. if _index._index-name = "{2}" then do: disp _index._index-name _index-field._index-seq. end. /* disp _index._index-name. disp _index-field._index-seq. */ end. if tnum = 0 then next. mbr: for each _field where _field-name = entry(1, tmatch) and _Data-Type = tdt[1] and _File-Recid ne recid(_File), xfile of _field: do idx = 2 to tnum: find xfld of xfile where xfld._field-name = entry(idx, tmatch) and xfld._Data-Type = tdt[idx] no-error. if not available xfld then next mbr. end. create relate. relate.owner = _file._file-name. relate.dumpowner = _file._dump-name. relate.mem = xfile._file-name. relate.dumpmem = xfile._dump-name. relate.idx = _index._index-name. relate.numfld = tnum. relate.matchlst = tmatch. end. end. for each relate break by owner by mem: if not (first-of (mem) and last-of (mem)) then do: display relate.owner relate.mem relate.idx with centered title "Duplicate relationships". delete relate. end. end.

Continue reading...
 
Status
Not open for further replies.
Top