UNLOCK: Difference between revisions

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search
(Created page with "The {{KW|UNLOCK}} statement opens access to parts or all of a file to other programs and network users. {{PageSyntax}} :<code>{{KW|UNLOCK}} [#]{{Parameter|fileNumber%}}</code> :<code>{{KW|UNLOCK}} [#]{{Parameter|fileNumber%}}, {{Parameter|record&}}</code> :<code>{{KW|UNLOCK}} [#]{{Parameter|fileNumber%}}, [{{Parameter|firstRecord&}}] TO {{Parameter|lastRecord&}}</code> {{PageDescription}} * {{Parameter|fileNumber%}} is the file number of the file to unlock. * In the...")
 
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
The {{KW|UNLOCK}} statement opens access to parts or all of a file to other programs and network users.
This statement opens access to parts or all of a file to other programs and network users.




{{PageSyntax}}
{{PageSyntax}}
:<code>{{KW|UNLOCK}} [#]{{Parameter|fileNumber%}}</code>
: [[UNLOCK]] [#]{{Parameter|fileNumber%}}
:<code>{{KW|UNLOCK}} [#]{{Parameter|fileNumber%}}, {{Parameter|record&}}</code>
: [[UNLOCK]] [#]{{Parameter|fileNumber%}}, {{Parameter|record&}}
:<code>{{KW|UNLOCK}} [#]{{Parameter|fileNumber%}}, [{{Parameter|firstRecord&}}] TO {{Parameter|lastRecord&}}</code>
: [[UNLOCK]] [#]{{Parameter|fileNumber%}}, [{{Parameter|firstRecord&}}] TO {{Parameter|lastRecord&}}




Line 14: Line 14:
* In the third syntax, the records or bytes in the range [{{Parameter|firstRecord&}},{{Parameter|lastRecord&}}] are unlocked. If {{Parameter|firstRecord&}} is omitted, it is assumed to be the first record or byte.
* In the third syntax, the records or bytes in the range [{{Parameter|firstRecord&}},{{Parameter|lastRecord&}}] are unlocked. If {{Parameter|firstRecord&}} is omitted, it is assumed to be the first record or byte.
* For files opened in [[BINARY]] mode, each record corresponds to a single byte.
* For files opened in [[BINARY]] mode, each record corresponds to a single byte.
* [[LOCK]] and UNLOCK statements are always used in pairs and each statement must match the other one.
* [[LOCK]] and [[UNLOCK]] statements are always used in pairs and each statement must match the other one.
* Files must be unlocked before other programs can access them, and before the file is closed.
* Files must be unlocked before other programs can access them, and before the file is closed.
* [[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Keyword Not Supported in Linux or MAC versions]]
* '''[[Keywords currently not supported by QB64#Keywords_not_supported_in_Linux_or_macOS_versions|Keyword not supported in Linux or macOS versions]]'''




{{PageSeeAlso}}
{{PageSeeAlso}}
* {{KW|LOCK}}
* [[LOCK]]
* {{KW|OPEN}}
* [[OPEN]]
* {{KW|ACCESS}}
* [[ACCESS]]




{{PageNavigation}}
{{PageNavigation}}

Latest revision as of 02:30, 24 January 2023

This statement opens access to parts or all of a file to other programs and network users.


Syntax

UNLOCK [#]fileNumber%
UNLOCK [#]fileNumber%, record&
UNLOCK [#]fileNumber%, [firstRecord&] TO lastRecord&


Description

  • fileNumber% is the file number of the file to unlock.
  • In the first syntax, the entire file is unlocked.
  • In the second syntax, record& is the record number of the file to unlock.
  • In the third syntax, the records or bytes in the range [firstRecord&,lastRecord&] are unlocked. If firstRecord& is omitted, it is assumed to be the first record or byte.
  • For files opened in BINARY mode, each record corresponds to a single byte.
  • LOCK and UNLOCK statements are always used in pairs and each statement must match the other one.
  • Files must be unlocked before other programs can access them, and before the file is closed.
  • Keyword not supported in Linux or macOS versions


See also



Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link