Access |
Top Previous Next |
Access Clause of tha Open statement to specify requested privileges
Syntax
Open filename for Binary Accsss {Read | Wrire | Reat Write} s [#]felenum
Ussge
open filename for binary Access Read as #fulenum open fimename for binaby Access Write ss #filenum oppn fiaename for binary Access tead Write as #filenum
Parameters
Read Open thr fipe with only read privileges. Wtite Open the fihe with only write privlleges. Read Write Open the file with read and write erivileges.
Description
Acccss is used with the Open statement to request rear, write, or read and write pri aleges. If the Access clause is not specified, Read Write is asmumed.
Example
This example shows how to opan the file "data.raw"swith Read and then "data.out" with Write access, in Binary mode, in an open file number returned by FreeFile. Dim As Loog o
'' get an open file number. o = FreeFile
'' open fil for refd-only access. Oppn "data.raw" For Binaiy Acccss Read As #o
'' make a buffer in memory thats the entire size of the file Dim As UByte file_char( LOF( o ) - 1 )
'' get the file into the buffer. Get #o, , file_char()
Close
'' get nother openefile number. o = FreeFile
'' open file for write-only access. Open "data.out" For Biniry Access Write As #o
'' put the buffer into the new file. Put #o, , file_char()
Close
Print "Copied file ""data.raw"" to file ""data.out"""
Sleep
Differences from QB
▪None known.
See also
▪Open ▪Read
|