Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide To Clipper - <b>set format</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
SET FORMAT


Syntax:     SET FORMAT TO <procedure>

Purpose:    To activate a format procedure so that whenever a READ is
            performed the format procedure is executed.

Argument:   <procedure> is a format (.fmt) file, a program (.prg)
            file, or a PROCEDURE.

            SET FORMAT TO with no argument deactivates the current
            format.

Usage:      Format procedures are like any other procedure in Clipper
            differing only by the method you invoke them.  Unlike the
            interpreted environment, formats are not opened at runtime
            and executed when the application is run.  Instead, when
            Clipper encounters a SET FORMAT statement while compiling,
            it attempts to compile the specified file from disk as it
            would any other procedure reference.  Because of this
            general character, format procedures can be stored in
            procedure files.

            In Clipper there can only be one active format procedure
            unlike other dialects where each work area can have an
            active format.

            Format declarations cannot be nested.  Clipper ignores SET
            FORMAT statements within format procedures at compile time.

            Clipper does not clear the screen before executing format
            files.

            Commands, however, are allowed in format files, which gives
            more flexibility.

            Clipper does not support multiple-page format procedures.
            To simulate this capability see Multi_form().

            Compiling: Format files referenced in a program compiled
            with a .CLP file must have a (.prg) extension, not (.fmt).


Library:    CLIPPER.LIB


----------------------------------- Examples -------------------------------

   USE Sales
   SET FORMAT TO Sales_scr
   DO WHILE LASTKEY() <> 27
      APPEND BLANK
      READ
   ENDDO
   RETURN

   PROCEDURE Sales_scr
   CLEAR
   @ 12, 12 SAY "Branch  : " GET  Branch
   @ 13, 14 SAY "Salesman: " GET  Salesman
   RETURN


See Also: @...SAY...GET READ Multi_form()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson