[adm2-dev] 9.1d dynamic find - Forum - OpenEdge Development - Progress Community
 Forum

[adm2-dev] 9.1d dynamic find

  • I came across 'dynamic find' in a web presentation about 9.1d new feature. I

    don't know if it's a 4GL feature, and if for a single record search it will

    be much more efficient than a dynamic query, if so I would like to know

    where to find doc of how to use it, if it exists.

    Thanks

    Sylvestre SEGURON

    To unsubscribe, e-mail: dev-unsubscribe@adm2.possenet.org

    For additional commands, e-mail: dev-help@adm2.possenet.org

  • Dynamic Find is really just a new method on the BUFFER object. It is

    substantially faster than creating a query and doing a GET FIRST because you

    don't have to go through the overhead of creating the query object,

    associating buffers with it, preparing it and then opening it.

    There is documentation on the 4 methods that are new (FIND-FIRST, FIND-LAST,

    FIND-UNIQUE and FIND-CURRENT) in the on-line help for 9.1D. On the on-line

    help "Index" page there is a prompt for the first few letters you are

    looking for. Type "Buffer object handle" in there. Double-click on that

    topin in the index and scroll down to the methods. They are all listed

    there.

    regards,

    Bruce

    Bruce S Gruenbaum, Principal Software Engineer

    the Progress Company

    http://www.progress.com

    bgruenba@progress.com

    -Original Message-

    From: Sylvestre Seguron

    Sent: Thursday, August 29, 2002 6:24 AM

    To: dev@adm2.possenet.org

    Subject: 9.1d dynamic find

    I came across 'dynamic find' in a web presentation about 9.1d new

    feature. I

    don't know if it's a 4GL feature, and if for a single record

    search it will

    be much more efficient than a dynamic query, if so I would like to know

    where to find doc of how to use it, if it exists.

    Thanks

    Sylvestre SEGURON

    To unsubscribe, e-mail: dev-unsubscribe@adm2.possenet.org

    For additional commands, e-mail: dev-help@adm2.possenet.org

    To unsubscribe, e-mail: dev-unsubscribe@adm2.possenet.org

    For additional commands, e-mail: dev-help@adm2.possenet.org

  • Hi Sylvestre,

    probably you're referring to the find-first method of a bufer object handle.

    You can find explanation about this in the 9.1D online help:

    Gets a single record. This method lets a user get the first record that

    satisfies the predicate expression.

    Return Type: LOGICAL

    Applies To: Buffer Object handle

    The FIND-FIRST method has the following syntax:

    SYNTAX

    FIND-FIRST (predicate-expression [ , lockmode ] )

    predicate-expression

    A character expression that evaluates to the following syntax:

    [ WHERE ]

    Once evaluated, predicate-expression can contain only constants and

    unabbreviated references to fields from the buffer.

    The predicate-expression itself can be built using a concatenation of

    character expressions.

    lockmode

    An integer expression evaluating to one of the following constants:

    SHARE-LOCK, EXCLUSIVE-LOCK, or NO-LOCK. You can assign any of these

    constants to an integer variable. For example, mylock = NO-LOCK.

    The default is SHARE-LOCK.

    wait-mode

    An integer expression evaluating to one of the following: NO-WAIT, 0, or ?.

    You can assign NO-WAIT to an integer variable. For example, mywait =

    NO-WAIT.

    The default is to wait.

    The following shows some examples of FIND-FIRST method:

    DEFINE VARIABLE bh AS HANDLE.

    DEFINE VARIABLE myname AS char.

    bh = BUFFER customer:HANDLE.

    bh:FIND-FIRST("where cust-num 2", NO-LOCK).

    do transaction ;  

    bh:FIND-FIRST("", EXCLUSIVE-LOCK).

    end.

    bh:FIND-FIRST("where name = " + QUOTER(myname) , NO-LOCK).

    If FIND-FIRST succeeds, it returns TRUE, otherwise it returns FALSE.

    If FIND-FIRST fails, it does not raise an error but displays a message. You

    can suppress this message by using NO-ERROR on the statement containing the

    method.

    Also see the FIND-BY-ROWID( ) Method, FIND-CURRENT( ) Method,

    FIND-LAST( ) Method, FIND-UNIQUE( ) Method, FIND Statement.

    Regards,

    Roland de Pijper

    Expertise Manager/Project Consultant

    Certified Progress Solution Designer

    Performance, not promises

    Progress Software BV

    Postbus 553

    2900 AN Capelle a/d IJssel

    The Netherlands

    Tel direct : +31(0)10-235 1149

    Fax : +31(0)10-235 1199

    Mobile : +31(0)6-50663738

    Progress e-coms. All you need to know and nothing more!

    Register now at http://ecoms.progress.com

    -Original Message-

    From: Sylvestre Seguron

    Sent: donderdag 29 augustus 2002 12:24

    To: dev@adm2.possenet.org

    Subject: 9.1d dynamic find

    I came across 'dynamic find' in a web presentation about 9.1d new

    feature. I

    don't know if it's a 4GL feature, and if for a single record

    search it will

    be much more efficient than a dynamic query, if so I would like to know

    where to find doc of how to use it, if it exists.

    Thanks

    Sylvestre SEGURON

    To unsubscribe, e-mail: dev-unsubscribe@adm2.possenet.org

    For additional commands, e-mail: dev-help@adm2.possenet.org

    To unsubscribe, e-mail: dev-unsubscribe@adm2.possenet.org

    For additional commands, e-mail: dev-help@adm2.possenet.org

  • I downloaded adm2 library and i found little bug within smartdatabrowser. I

    patched this bug, but latest cvs snapshots already has this bug. I send

    explanation of this bug here:

    /* src/adm2/browser.p, initializeObject procedure */

    DO WHILE VALID-HANDLE(hColumn):

    cFieldHandles = cFieldHandles +

    (IF cFieldHandles NE "":U THEN "," ELSE "":U) + STRING(hColumn).

    IF LOOKUP(hColumn:NAME, cEnabledFields) NE 0 THEN

    cEnabledHandles = cEnabledHandles +

    (IF cEnabledHandles NE "":U THEN ",":U ELSE "":U)

    + STRING(hColumn).

    ASSIGN

    hColumn:BGCOLOR = IF

    <> '':U

    THEN hColumn:BGCOLOR

    ELSE 7

    hColumn:LABEL = (IF lDynamic THEN

    ELSE

    hColumn:LABEL

    )

    /* hColumn:AUTO-RESIZE = TRUE */

    hColumn:RESIZABLE = TRUE

    /* Affordance for non-sorted columns (calculated)

    */

    NO-ERROR.

    The problem is "hColumn:AUTO-RESIZE = TRUE" command. when smartdatabrowser

    is run, this assignment is bypassing any special changing within programme.

    I think that this assignment must remove from there.

    Also, "hColumn:RESIZABLE = TRUE" line must remove, too. Because, this

    properties can assign by programmer within development cycle and it is not

    need to assign automaticly.

    Sorry for my poor English,

    --

    Regards,

    Dogan Zorlu,

    Grup Software, Izmir - Turkiye

    To unsubscribe, e-mail: dev-unsubscribe@adm2.possenet.org

    For additional commands, e-mail: dev-help@adm2.possenet.org

  • Dogan,

    You should enter an issue for this. Preferably with some explicit examples

    on what you need to do that conflictes with these implicit settings.

    I guess your problem could be solved if we support these as setable adm

    properties, but explicit examples would be very helpful both to understand

    the problem better and to prioritize the issue.

    HÃ¥vard

    -Original Message-

    From: Dogan Zorlu

    Sent: Thursday, August 29, 2002 8:26 AM

    To: dev@adm2.possenet.org

    Subject: SmartBrowser Initialize Object problem

    I downloaded adm2 library and i found little bug within smartdatabrowser. I

    patched this bug, but latest cvs snapshots already has this bug. I send

    explanation of this bug here:

    /* src/adm2/browser.p, initializeObject procedure */

    DO WHILE VALID-HANDLE(hColumn):

    cFieldHandles = cFieldHandles +

    (IF cFieldHandles NE "":U THEN "," ELSE "":U) + STRING(hColumn).

    IF LOOKUP(hColumn:NAME, cEnabledFields) NE 0 THEN

    cEnabledHandles = cEnabledHandles +

    (IF cEnabledHandles NE "":U THEN ",":U ELSE "":U)

    + STRING(hColumn).

    ASSIGN

    hColumn:BGCOLOR = IF

    <'':U

    THEN hColumn:BGCOLOR

    ELSE 7

    hColumn:LABEL = (IF lDynamic THEN

    ELSE

    hColumn:LABEL

    )

    /* hColumn:AUTO-RESIZE = TRUE */

    hColumn:RESIZABLE = TRUE

    /* Affordance for non-sorted columns (calculated)

    */

    NO-ERROR.

    The problem is "hColumn:AUTO-RESIZE = TRUE" command. when smartdatabrowser

    is run, this assignment is bypassing any special changing within programme.

    I think that this assignment must remove from there.

    Also, "hColumn:RESIZABLE = TRUE" line must remove, too. Because, this

    properties can assign by programmer within development cycle and it is not

    need to assign automaticly.

    Sorry for my poor English,

    --

    Regards,

    Dogan Zorlu,

    Grup Software, Izmir - Turkiye

    To unsubscribe, e-mail: dev-unsubscribe@adm2.possenet.org

    For additional commands, e-mail: dev-help@adm2.possenet.org

    To unsubscribe, e-mail: dev-unsubscribe@adm2.possenet.org

    For additional commands, e-mail: dev-help@adm2.possenet.org

  • Havard,

    Thank's for your response.

    Okey,

    we have a one smartbrowser,one smartwindow and one smartdataobject.

    Smartdataobject contains 3 field, name x(50) ,surname x(50) and phone x(15).

    when i run this proc, smartbrowser shows data and all column width

    calculating automaticly. But, i want to set width of the name column to 15. i

    can set this properties within SmartDataBrowser's colon editor.

    After this change, i run proc again. Oh, SmartDataBrowser recalculate name

    column width and show's 50 characters again. I could't set column width

    maualy under this situation.

    The problem is SmartDataBrowser's initializeobject. This procedures turn AUTO-

    RESIZE property to TRUE for every column of Browser widget when

    initialization phase. We can setting column width property of some column

    within SmartDataBrowser design, but at runtime initialize object procedure

    forcing our changes and says recalculating column width automaticly to

    browser widget.

    I resolved this problem. I commented "hColumn:AUTO-RESIZE = TRUE" line within

    browser.p's initializeObject and recompiled.

    But, standart distribution and your browser.p in cvs tree has this bug (i say

    bug, because e can set width, bur smartdatabrowser is not shows this). Every

    cvs update procedure, i always see browser.p updated.

    I resolved problem, but the others may not know this situation and they will

    be says "hah, smart objets ? very poor packets. blah blah blah. Progress

    V9.1d ? get out, etc, etc".

    Dogan,

    You should enter an issue for this. Preferably with some explicit examples

    on what you need to do that conflictes with these implicit settings.

    I guess your problem could be solved if we support these as setable adm

    properties, but explicit examples would be very helpful both to understand

    the problem better and to prioritize the issue.

    HÃ¥vard

    -Original Message-

    From: Dogan Zorlu

    Sent: Thursday, August 29, 2002 8:26 AM

    To: dev@adm2.possenet.org

    Subject: SmartBrowser Initialize Object problem

    I downloaded adm2 library and i found little bug within

    smartdatabrowser. I patched this bug, but latest cvs snapshots

    already has this bug. I send explanation of this bug here:

    /* src/adm2/browser.p, initializeObject procedure */

    DO WHILE VALID-HANDLE(hColumn):

    cFieldHandles = cFieldHandles +

    (IF cFieldHandles NE "":U THEN "," ELSE "":U) +

    STRING(hColumn). IF LOOKUP(hColumn:NAME, cEnabledFields) NE 0

    THEN cEnabledHandles = cEnabledHandles +

    (IF cEnabledHandles NE "":U THEN ",":U ELSE "":U)

    + STRING(hColumn). ASSIGN hColumn:BGCOLOR = IF {fnarg

    columnTable hColumn:NAME hDataSource} <'':U

    THEN hColumn:BGCOLOR ELSE 7

    hColumn:LABEL = (IF lDynamic THEN {fnarg

    columnColumnLabel hColumn:NAME hDataSource} ELSE

    hColumn:LABEL

    )

    /* hColumn:AUTO-RESIZE = TRUE */

    hColumn:RESIZABLE = TRUE

    /* Affordance for non-sorted columns

    (calculated) */ NO-ERROR.

    The problem is "hColumn:AUTO-RESIZE = TRUE" command. when smartdatabrowser

    is run, this assignment is bypassing any special changing within programme.

    I think that this assignment must remove from there.

    Also, "hColumn:RESIZABLE = TRUE" line must remove, too. Because, this

    properties can assign by programmer within development cycle and it

    is not need to assign automaticly.

    Sorry for my poor English,

    --

    Regards,

    Dogan Zorlu,

    Grup Software, Izmir - Turkiye

    To unsubscribe, e-mail: dev-unsubscribe@adm2.possenet.org

    For additional commands, e-mail: dev-help@adm2.possenet.org

    To unsubscribe, e-mail: dev-unsubscribe@adm2.possenet.org

    For additional commands, e-mail: dev-help@adm2.possenet.org

    --

    Dogan Zorlu,

    Grup Software, Izmir - Turkiye

    To unsubscribe, e-mail: dev-unsubscribe@adm2.possenet.org

    For additional commands, e-mail: dev-help@adm2.possenet.org