project QadFinancials > class BDomain > method GetCodePageList

Description

Returns a list of code pages


Parameters


ocCodePagesoutputcharacter
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program1/bdomain.p)

    
    /* ================== */
    /* Exception Handling */
    /* ================== */
    assign oiReturnStatus      = -98
           viLocalReturnStatus = 0.
                              
    /* ==================== */
    /* Start a global block */
    /* ==================== */
    PROCESSLISTBLOCK: DO :
        
        /* ================================================================== */
        /* Fill the list with the code-pages that we have in the preprocessor */
        /* ================================================================== */
        assign ocCodePages = {&DOMAINPROPERTY-CODEPAGES}.
        
        /* ======================================================================================================================== */
        /* Extend the list with the code-pages that can be in an optional entry in the server.xml file                              */
        /* Note that for each code-page in the file there is only a single entry while the entries in the list are double-oriented  */
        /* (a first one for the value on the screen in the drop-down and a second one for the value of the field)                   */
        /* ======================================================================================================================== */
        <M-22 run MainBlock  () in XML>
        <M-23 run ReadXMLNodeValue
           (input  search('server.xml') (icXMLFile), 
            input  'serverConfiguration' (icStartTag), 
            input  'CODEPAGES':U (icNodeTag), 
            output vcCodePagesFromFile (ocNodeValue), 
            output viFileReadingReturnStatus (oiReturnStatus)) in XML>
        run gipr_deleteprocedure in vhFcComponent.
        delete procedure vhFcComponent.
        if viFileReadingReturnStatus <> 0
        then do :
            assign viLocalReturnStatus = viFileReadingReturnStatus.
            Leave PROCESSLISTBLOCK.
        end. /* if viFileReadingReturnStatus <> 0 */
        if vcCodePagesFromFile       = "":U or 
           vcCodePagesFromFile       = ?    or
           trim(vcCodePagesFromFile) = "":U
        then Leave PROCESSLISTBLOCK.
        
        /* ============================================================= */
        /* Extend the list with the code-pages tfrom the server.xml file */
        /* ============================================================= */
        assign vcCodePagesFromFile = trim(vcCodePagesFromFile).
        do viEntryCounter = num-entries(vcCodePagesFromFile,",":U) to 1 by -1 : 
            assign ocCodePages = ocCodePages                                     + chr(2) + 
                                 entry(viEntryCounter,vcCodePagesFromFile,",":U) + chr(2) + 
                                 entry(viEntryCounter,vcCodePagesFromFile,",":U). 
        end. /* do viEntryCounter = num-entries(trim(vcCodePagesFromFile),",":U) to 1 by -1 :  */
        if ocCodePages begins chr(2) and 
           length(ocCodePages,"character":U) > 1
        then assign ocCodePages = substring(ocCodePages,2,-1,"character":U).
        
    END. /* PROCESSLISTBLOCK */
    
    /* ================== */
    /* Exception Handling */
    /* ================== */
    assign oiReturnStatus = viLocalReturnStatus.