Use this command to attach a file opened in a previous program to the current program.
ROPEN f/c/e | Required - 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). |
ADDALLFLDS | If 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
Page url: http://www.cassoftware.com/tas/manual/reopenfile.htm