File (internal function): Difference between revisions

From BR Wiki
Jump to navigation Jump to search
m (1 revision)
 
No edit summary
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:


  File(N)
  File(<[[file handle]]>)


The '''File''' [[internal function]] will return the numeric value that specifies the status of file N.  N is a [[File Handle]].
The '''File''' [[internal function]] returns the numeric value that specifies the status of file associated with the [[File Handle]].


{|
{|
Line 21: Line 21:


====Comments and Examples====
====Comments and Examples====
''Print File(N)'' will return -1 when the file N is not opened. File(N) can be used to separate input from output errors in file processing, including communications files.
''Print File(N)'' will return -1 when the file N is not opened. File(N) can be used to separate input from output errors in file processing, including communications files.


 
====Window Interrogation====
====Extended Syntax====
Using file with the optional parameters, [[WINDOW_RECT]] or [[USABLE_RECT]] allows BR to distinguish between window dimensions and the useable area of windows.
 
As of Business Rules! [[4.20]] file's syntax has been expanded to allow the querying of a windows size and shape.
 
  file(nn,"WINDOW_RECT | USABLE_RECT", MAT num-arrayname)
  file(nn,"WINDOW_RECT | USABLE_RECT", MAT num-arrayname)


BR distinguishes between window dimensions and the useable area of windows.
The above file() reference redimensions num-arrayname to 4 elements and returns X (horizontal), Y (vertical), Width, and Height in pixels of either the window or usable area rectangle.  


The above file() reference redimensions num-arrayname to 4 elements and returns nX (horizontal), Y (vertical), Width, and Height in pixels of either the window
====Fontsize====
or usable area rectangle.
Using File with FONTSIZE returns a two element array with the height and width of each fixed character position in pixels (used for positioning and sizing controls). For example:
file(N,"FONTSIZE", MAT num-arrayname)


file(nn,"FONTSIZE", MAT num-arrayname)
This FONTSIZE reference returns a two element array with the height and width of each fixed character position in pixels (used for positioning and sizing controls).


=====extended syntax examples=====
=====extended syntax examples=====


  file(101,'WINDOW_RECT',mat x)
  file(101,'WINDOW_RECT',mat x)
returns 4 items in mat x
returns 4 items in mat x
*x(1)=left
*x(1)=left
Line 54: Line 51:
*[[File$]]
*[[File$]]
*[[FileNum]]
*[[FileNum]]
*[[FreeSP]]
*[[FREESP]]
*[[KLn]]
*[[KLn]]
*[[KPs]]
*[[KPs]]

Latest revision as of 17:11, 24 September 2014

File(<file handle>)

The File internal function returns the numeric value that specifies the status of file associated with the File Handle.

-1 File not opened.
0 Operation performed successfully.
10 End of file occurred during input.
11 End of file occurred during output.
20 Transmission error during input.
21 Transmission error during output.

Comments and Examples

Print File(N) will return -1 when the file N is not opened. File(N) can be used to separate input from output errors in file processing, including communications files.

Window Interrogation

Using file with the optional parameters, WINDOW_RECT or USABLE_RECT allows BR to distinguish between window dimensions and the useable area of windows.

file(nn,"WINDOW_RECT | USABLE_RECT", MAT num-arrayname)

The above file() reference redimensions num-arrayname to 4 elements and returns X (horizontal), Y (vertical), Width, and Height in pixels of either the window or usable area rectangle.

Fontsize

Using File with FONTSIZE returns a two element array with the height and width of each fixed character position in pixels (used for positioning and sizing controls). For example:

file(N,"FONTSIZE", MAT num-arrayname)


extended syntax examples
file(101,'WINDOW_RECT',mat x)

returns 4 items in mat x

  • x(1)=left
  • x(2)=top
  • x(3)=width
  • x(4)=height


See Also

For additional information about files, see the following: