project QadFinancials > class BProjectStatus > method CalcAllSelectProjectStatus

query calculated fields procedure

Description

Assign a value to query calculated fields


Parameters


oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
query SelectProjectStatus


program code (program1/bprojectstatus.p)

assign vcProjectSystemStatuses = {&PROJECTSYSTEMSTATUSES}.

create query vhQuery in widget-pool "non-persistent".
vhQuery:set-buffers(ih_Buffer).
vhQuery:query-prepare("for each ":U + ih_Buffer:table).
vhQuery:query-open().
vhQuery:get-first().
do while not vhQuery:query-off-end:
    assign {&tcProjectStatusSystemStatusCalc} = '?':U.
    
    do viCounter = num-entries(vcProjectSystemStatuses, chr(2)) to 1 by -2 :
        if entry(viCounter, vcProjectSystemStatuses, chr(2)) = {&tcProjectStatusSystemStatus}
        then do :
            assign {&tcProjectStatusSystemStatusCalc} = entry(viCounter - 1,
                   vcProjectSystemStatuses, chr(2)) no-error.
            leave.
        end.
    end.
    vhQuery:get-next().
end.
vhQuery:query-close().
delete object vhQuery.