1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

How to matches two records using ENTRY in progress 4GL?

Discussão em 'StackOverflow' iniciado por fdantas, Março 26, 2019.

  1. fdantas

    fdantas Administrator Moderador

    I have written a program for matching two records. If its matching then i need to have a message "Matched" but the problem here is I don't get any idea about how to matching. Let me share my program

    DEFINE VARIABLE cPos AS INTEGER NO-UNDO.
    DEFINE TEMP-TABLE tt_data NO-UNDO
    FIELD cPosition AS CHARACTER FORMAT "X(60)"
    FIELD cEndCode AS CHARACTER
    FIELD cShotCode AS CHARACTER.

    CREATE tt_data.
    ASSIGN
    tt_data.cPosition ="S$$$^^^^^^^^^^$$$^^^MC^^^^^^^^^^^^R^^^^^^^^^^^^^^^^^^^^^^^^^"
    tt_data.cEndCode = 10
    tt_data.cShotCode = "S".

    CASE tt_data.cEndCode:

    WHEN 10 THEN DO:
    cPos = 1.
    END.

    WHEN 20 THEN DO:
    cPos = 2.
    END.
    .
    .
    .
    WHEN 600 THEN DO:
    cPos = 60
    END.

    END CASE.

    FIND FIRST tt_date WHERE tt_data.cShotCode = SUBSTRING(tt_data.cPosition,cPos,1) NO-LOCK NO-ERROR.

    DISPLAY tt_data.cShotCode. /* Displayed Value is S */



    If you see tt_datacEndCode value is 10 which means its pointing ENTRY 1 of tt_data.cPosition (i.e. S). When 20 then its for ENTRY 2 like wise i want to get up to 600 (i.e. tt_datacEndCode = 60 ). The problem here is i cannot have WHEN statement up to 600. So Could you please help this case

    Continue reading...

Compartilhe esta Página