Navigation:  Reference > Commands >

Reopen File

Print this Topic Previous pageReturn to chapter overviewNext page

 

Use this command to attach a file opened in a previous program to the current program.

 

ROPEN f/c/eRequired - This is the number of the file in the previous program.  This value can be passed to a subsequent program through the use of the reset option in the DEFINE command or as a PARAM (Parameter).

ADDALLFLDSIf you specify this option the program will load all the fields from the data dictionary when the file is opened.  This is only necessary if you have not specified any of the fields from this file within the program itself when it was compiled.

 

       NOTE:  During compilation the fields that make up any files used in the program will be automatically added to the field list.  This will allow you to add fields to the screen form or report form after the program has been compiled and without recompiling.

 

COMMENT

If a record was active when the new program is run then that data will be available.  Any action taken by the subsequent program will still be there when it returns to the previous program.  This includes any records deleted, added, etc.  Also, if a file error occurs in this program and it returns to the previous program with no other actions to that file, the error will still be in effect and you will be able to test for it using the FLERR() function.

 

You may use any fields from a reopened file in this program just as though that file was opened normally.  The file, however, cannot be closed with the CLOSE command and will not be closed automatically when the program quits.

 

EXAMPLE

IF BKSYTERM_HNDL = 0 // if the file is not open

    OPENV 'BKSYTERM' FNUM BKSYTERM_HNDL LOCK N // open the table normally

ELSE

    ROPEN BKSYTERM_HNDL //the file has been opened so we reopen

ENDIF

 

SEE ALSO

OPENV

 

 


Page url: http://www.cassoftware.com/tas/manual/reopenfile.htm