project BLF > class BFcTranslation > method ReadProjectCode
Description
Read the project code for the master project.
THis is always located in xml/ProjectCode.xml.
Parameters
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
BLF
program code (program9/bfctranslation.p)
vcMainProjectCode = "".
do viFcCount1 = num-entries(propath) to 1 by -1:
file-info:file-name = entry (viFcCount1,propath) + "/xml/projectcode.xml".
if file-info:file-type begins "F"
then do:
CREATE X-DOCUMENT vhDoc in widget-pool "non-persistent".
vhDoc:LOAD("file", file-info:full-pathname, FALSE).
create x-noderef vhNode in widget-pool "non-persistent".
CREATE X-NODEREF vhText in widget-pool "non-persistent".
vhDoc:GET-CHILD(vhNode,1).
vhNode:GET-CHILD(vhText,1).
if vcMainProjectCode = ""
then vcMainProjectCode = vhText:NODE-VALUE.
else vcMainProjectCode = vcMainProjectCode + "," + vhText:NODE-VALUE.
delete object vhNode.
delete object vhText.
delete object vhDoc.
end.
end.
if vcMainProjectCode = ""
then do:
assign oiReturnStatus = -3.
<M-1 run SetMessage
(input 'Cannot find the XML file containing the project code (xml/projectcode.xml)':U (icMessage),
input '' (icArguments),
input '' (icFieldName),
input '' (icFieldValue),
input 'E':U (icType),
input 1 (iiSeverity),
input '' (icRowid),
input 'BLF-106':U (icFcMsgNumber),
input '' (icFcExplanation),
input '' (icFcIdentification),
input '' (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BFcTranslation>
return.
end.