[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Assign                   Assigns File or Device to File Variable

 Assign(var F : <file type>; FileName : <string>);                       [TP]

    Assigns a particular disk file or logical device to a file variable.
    This procedure must be called before any other procedures that
    manipulate the file.

               F    Any type of file: text, data, or untyped

        FileName    Name of the file; must follow MS-DOS requirements; can
                    include drive and path specifications; can also be a
                    logical device name (see list below)

    It is possible to assign a logical device, such as a printer, a serial
    port, or the screen, to a file variable. Here are the acceptable names
    for such devices:

            CON:    the console device; usually screen and keyboard;
                    buffered

            TRM:    the terminal device; screen and keyboard; no buffering

            KBD:    the keyboard; input only; no echoing is done

            LST:    the list device; usually the printer; output only

            AUX:    same as COM1:, the first serial port

            USR:    the user device, which you can define yourself

            INP:    MS-DOS standard input file (handle 0)

            OUT:    MS-DOS standard output file (handle 1)

            ERR:    MS-DOS standard error output file (handle 2)

    Most of these logical devices are also available as predefined file
    variables (CON, TRM, KBD, LST, AUX, USR, INPUT, and OUTPUT).

  -------------------------------- Example ---------------------------------

           Assign(DFile,'C:\DATA\CALENDAR.DTA');
           Assign(UFile,'RAWSTUFF.BIN');
           Assign(TFile,'OUT:');

See Also: Reset Rewrite Append Close files
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson