Wednesday, June 8, 2005

From the Edge: Getting Record Count and Current Record Number
Section: PROPERTY and GETPROPERTY Commands      
Chapter: Running R:BASE Your Way!
Platform: R:BASE 7.5 and V-8 "Turbo" for Windows
Builds: 7.5.8.30603 or higher

Among major tools, features and enhancements, R:BASE 7.5 and
V-8 "Turbo" includes support for more PROPERTY and GETPROPERTY
commands. Using the following GETPROPERTY and PROPERTY commands,
you can dynamically display the actual record count as well as
the currently positioned record in a form.

Let's implement this feature in your existing R:BASE 7.5 form.

01. While in Form Designer, place a Static Text, with some
    caption, with the following object property:

    Form Designer | Standard Controls | Static Text

    Object Property:

    Width: 220
    Caption: RecInfo
    Caption Alignment: Left
    Background Color: White
    Font Style: Bold
    Font Size: 8
    Color: Green
    Component ID: RecInfo                                                       

02. Use the following EEP as Custom... "On Row Entry" EEP:

    Form Designer | Table | Add Remove Table... | Main Table
    | Table Settings ...

    (Assuming that the Customer is the Main Table for your form)

    CLEAR VAR vRecordCount, vRecNo, vRecInfo
    SET VAR vRecordCount TEXT = NULL
    SET VAR vRecNo TEXT = NULL
    SET VAR vRecInfo TEXT = NULL
    GETPROPERTY TABLE 'Customer->RECORDCOUNT' vRecordCount
    GETPROPERTY TABLE 'Customer->RECNO' vRecNo
    SET VAR vRecInfo = ('  Record'&.vRecNo&'of'&.vRecordCount)
    PROPERTY RecInfo CAPTION .vRecInfo
    CLEAR VAR vRecordCount, vRecNo, vRecInfo
    RETURN

03. Save the form and close form designer

04. At the R> prompt or in a command file:

    EDIT USING formname WHERE ... ORDER BY ...

    Notice the dynamically displayed actual record count as well
    as the position number of the focus record.

For a PDF version of this document, please visit:

From The Edge: http://www.razzak.com/fte
(Powered by R:WEB Suite)

A sample application to demonstrate the use of such GETPROPERTY
and PROPERTY commands is also available at:

http://www.razzak.com/sampleapplications

Enjoy and make sure to have fun!

Very Best R:egards,

Razzak.

Reply via email to