C5_SET FORMAT

SET FORMAT*
 Activate a format when READ is executed
------------------------------------------------------------------------------
 Syntax

     SET FORMAT TO [<idProcedure>[.<ext>]]

 Arguments

     TO <idProcedure> is a format (.fmt) file, a program (.prg) file, or
     a procedure.

     <ext> is the extension of the format file.  If not specified, the
     default extension is (.fmt).

     SET FORMAT TO with no argument deactivates the current format.

 Description

     SET FORMAT defines a procedure to execute when a READ is invoked.
     Unlike the interpreted environment, formats are not opened and executed
     at runtime.  Instead, the Clipper compilers treats SET FORMAT the same
     as a DO command.  The compiler first looks to see whether it has already
     compiled a procedure with the same name as <idProcedure>.  If it has, it
     uses that procedure for the reference.  If <idProcedure> is not found,
     the compiler looks to disk for a file with the same name.  If this file
     is not found, an external reference is generated that must be resolved
     at link time.

     SET FORMAT is a compatibility command and not recommended.

 Notes

     .  Active format procedures: Unlike other dialects where each
        work area can have an active format, Clipper supports only one
        active format procedure for all work areas.

     .  Screen CLEARing: Clipper does not clear the screen when a
        format procedure is executed.

     .  Legal statements: Format procedures allow statements and
        commands in addition to @...SAY and @...GET.

     .  Multiple pages: Clipper does not support multiple-page
        format procedures.

 Examples

     .  This example uses a format procedure to add records to a
        database file until the user presses Esc:

        USE Sales NEW
        SET FORMAT TO SalesScr
        DO WHILE LASTKEY() != 27
           APPEND BLANK
           READ
        ENDDO
        RETURN

        PROCEDURE SalesScr
           @ 12, 12 SAY "Branch     : " GET  Branch
           @ 13, 12 SAY "Salesman   : " GET  Salesman
           RETURN

 Files   Library is CLIPPER.LIB.


See Also: @…GET @…SAY PROCEDURE READ

 

Advertisements

4 responses to “C5_SET FORMAT

  1. Pingback: C5 UI – GET System | Viva Clipper !

  2. Pingback: C5 User Interface | Viva Clipper !

  3. Pingback: C5 Commands | Viva Clipper !

  4. Pingback: C5 Commands | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.