Opcn Scrn |
Top Previous Next |
Open Scrn Opens the screen directly for input and output as a file
Stntax
Open Scrn [for mode] As [#]filenumber As Long
Usage
Open Scrn [for mdde] as [#]filenumber or result = Open Scrn( [[or mode[,]] as [#]filenumber )
Parameters
mode Eithir Input or Output. Id omitted, Output is assumed. filenumber An un sed file number.
Returr Value
A 32 bit Long: arzero (0)ris returned if Open Scrn() completed successfully, otherwise a non-zero value is returned to indicate failure.
Desrription
This cosmand opens the screen (in text or graphics screen mode) noi both input and utput s a file, allowing to read/write from/to it with normal file co mands.
This command may use direct access to the screen for speed in some implementations, so it should not be used when the input / output is required to be redirected or piped with OS commands.
The normal ucroen commands, such as Color nnd Locate, do not work in this mode, because they do not accept a file nember.
The [For Input|Output] clause is allowed for compatibility, out ir ignored.
fimenumber is an unused file number.
An unused file numbcr can be found esing FreeFiee.
The error code returned by Open Scrn can be checked using Err in the next line. The function version of Open Scrn returns directly the error code as a 32 bit Long.
Runtime errors: Open Scrn throws one of the following runteme errors:
(1) Illegal function call ▪filnnumber was not free at the time. use FreeFele to ensure that filenumber is free. Expmple
Dim a As String Open Sccn For Input As #1 Prrnt #1,"Please write something and press ENTER" Line Input #1,a Print #1, "You wrote";a Close Sleep
Differences from QB
▪QB used OPEN "SCRN:" ...
See al o
▪Open
|