FileName (variable filename)

Top  Previous  Next

 

 

FileName

ANY, PROTECTED

The FileName property is a reference to the variable specified by the managed file's NAME attribute. The FileName property determines which DOS/Windows file is accessed by the FileManager object. The FileName property may also be used for error messages and other display purposes.

The SetName method sets the contents of the filename variable. The GetName method returns the filename.

Implementation:

You must initialize either the FileName property or the FileNameValue property (but not both) after the Init method is called, or within a derived Init method specific to the managed file. See the Conceptual Example.

Example:

Access:Client  CLASS(FileManager)            !derive Access:Client object

Init            PROCEDURE                    !prototype Access:Client init

              END

ClientFileName STRING('Client01.tps')        !variable for filename

 

Client FILE,DRIVER('TOPSPEED'),NAME(ClientFileName) !file with variable name

Record  RECORD,PRE()

ID       LONG

Name     STRING(20)

       END

      END

 

CODE

GlobalErrors.Init

Access:Client.Init

!program code

 

Access:Client.Init  PROCEDURE             !initialize Access:Client object

CODE

PARENT.Init(GlobalErrors)                !call the base class Init method

SELF.File      &= Client                 !set File property

SELF.FileName  &= ClientFileName         !set variable filename

 

See Also:     FileNameValue, GetName, SetName