ACCESS
Usually combined with OPEN or ASK, sets or returns the access mode users have to an open file.
Implemented by: ansifull, QBasic, VBDOS, FreeBASIC
With variations: Gambas (as a function)
Also written as:
Usage
In the MS-QuickBASIC family, VBDOS and FreeBASIC, ACCESS is part of an OPEN statement with a network-shared file.
OPEN filepath$ FOR INPUT ACCESS READ AS #1
The ANSI Standard "Full" BASIC specification shows ACCESS as one of the possible arguments for OPEN and ASK in the so-called "file operations" (section 11.1). The values it could take or return would be the strings INPUT, OUTPUT and OUTIN. If used with ASK, ACCEPT should be followed by a string variable name, which would be loaded with the return value.
OPEN #1: NAME "anyfile.txt", ACCESS INPUT, ORGANIZATION SEQUENTIAL ASK #1: ACCESS A$ PRINT A$
Variations
Gambas implements ACCESS purely as a boolean function that returns TRUE if the given filepath can be acessed by the application/user in an optionally given mode in the form of a constant from the gb
class (gb.Read
if ommited):
Print Access ("/root", gb.Write) ' FALSE