Returns the status of the most recent operation.
None. The parentheses are mandatory.
The STATUS function returns an integer code that indicates the status of the most recently completed MVBasic operation for the current process. Many, but not all, MVBasic operations change the STATUS function value. MVBasic sets STATUS upon successful completion of an operation (completion without issuing an error).
STATUS returns 0 when an operation performed the intended task, and a non-zero integer (positive or negative) to indicate a situation that prevented the intended completion of the task. For example, a command could have completed without error but performed no operation because a specified operand was of the wrong type, or the specified operand was already in the state that the command was supposed to establish.
MVBasic initializes the STATUS function value to 0. The STATUS function value persists until changed by the successful completion of an operation. Exiting and reentering the MV Shell resets the STATUS function value to 0. You can set the STATUS function value to a user-defined positive or negative integer value using the ASSIGN statement.
The STATUS function value is set by the following commands. Please see the individual command for the applicable status code values: BSCAN, CLEARFILE, CLOSE, CLOSESEQ, CREATE, DELETE, DELETESEQ, EXECUTE, FILELOCK, FILEUNLOCK, INPUT, OPEN, OPENPATH, OPENSEQ, READ, READBLK, READL, READSEQ, READU, READVL, READVU, SEEK, WEOFSEQ, WRITE, WRITEBLK, WRITESEQ, WRITESEQF, WRITEU, WRITEV, and WRITEVU.