project QadFinancials > class BPaymentFormat > method CalcAllSelectPayFormatType

query calculated fields procedure

Description

Assign a value to query calculated fields


Parameters


oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
query SelectPayFormatType


program code (program1/bpaymentformat.p)

assign vcPayFormatPayTypes           = {&PAYFORMATPAYTYPES}
       vcPayFormatTypeModules        = {&PAYFORMATMODULES}
       vcPayFormatTypePayInstruments = {&PAYFORMATPAYINSTRUMENTS}.

create query vhQuery in widget-pool "non-persistent".
vhQuery:forward-only = yes.
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 {&tcPayFormatTypePayTypeTr} = '?':U.
    do viCounter = num-entries(vcPayFormatPayTypes,chr(2)) to 2 by -2:
        if entry(viCounter,vcPayFormatPayTypes,chr(2)) = {&tcPayFormatTypePayType}
        then do:
            assign {&tcPayFormatTypePayTypeTr} = entry(viCounter - 1,vcPayFormatPayTypes,chr(2)) no-error.
            leave.
        end.
    end.

    assign {&tcPayFormatTypeModuleTr} = '?':U.
    do viCounter = num-entries(vcPayFormatTypeModules,chr(2)) to 2 by -2:
        if entry(viCounter,vcPayFormatTypeModules,chr(2)) = {&tcPayFormatTypeModule}
        then do:
            assign {&tcPayFormatTypeModuleTr} = entry(viCounter - 1,vcPayFormatTypeModules,chr(2)) no-error.
            leave.
        end.
    end.

    assign {&tcPayFormatTypePayInstrumentTr} = '?':U.
    do viCounter = num-entries(vcPayFormatTypePayInstruments,chr(2)) to 2 by -2:
        if entry(viCounter,vcPayFormatTypePayInstruments,chr(2)) = {&tcPayFormatTypePayInstrument}
        then do:
            assign {&tcPayFormatTypepayInstrumentTr} = entry(viCounter - 1,vcPayFormatTypePayInstruments,chr(2)) no-error.
            leave.
        end.
    end.

    vhQuery:get-next().
end.
vhQuery:query-close().
delete object vhQuery.