.TITLE GBLSECUFO Global Section UFO (User FIle Open) .IDENT 'X-1' ;**************************************************************************** ;* * ;* COPYRIGHT (c) 1978, 1980, 1982, 1984 BY * ;* DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS. * ;* ALL RIGHTS RESERVED. * ;* * ;* THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED * ;* ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE * ;* INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER * ;* COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY * ;* OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY * ;* TRANSFERRED. * ;* * ;* THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE * ;* AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT * ;* CORPORATION. * ;* * ;* DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS * ;* SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL. * ;* * ;* * ;**************************************************************************** ;This routine opens a file to be used as a global section ;An RMS OPEN is performed with the file options (FOP) of ;User File Open (UFO). The calling routine specifies the ;file name and number of blocks; this routine returns the ;channel number on which the file was openned. ;If the specified file does not exist, the file is created ; ;The calling sequence is ; ; Call GBL_SECTION_UFO( blkcnt,file-name,chan ) ; ; Where ; blkcnt => Number of blocks in the file ; file-name => filename descriptor block ; chan => channel openned ; ; ; ;Example: ; Integer*4 CHANNEL ; : ; : ; Call GBL_SECTION_UFO(10,'LABIO_DATA.DAT',CHANNEL ) .SBTTL GBL_SEC_UFO ; RMS FAB for a $CREATE GBLFAB: $FAB FAC=PUT,- FOP= NUM_ARG = 3 ;Number of arguments .ENTRY GBL_SECTION_UFO,0 MOVL #SS$_INSFARG,R0 ;Assume bad arg count CMPB (AP),#NUM_ARG ;Check arg count BLSS EXIT ;Too few MOVL 8(AP),R1 ;Get file name address string descriptor MOVB (R1),GBLFAB+FAB$B_FNS ;Store string length in FAB MOVL 4(R1),GBLFAB+FAB$L_FNA ;And file name MOVL @4(AP),GBLFAB+FAB$L_ALQ ;Number of blocks to allocate $CREATE FAB=GBLFAB ;Open data file, Create it if ;if it does not exist MOVL GBLFAB+FAB$L_STV,@12(AP);Store channel number EXIT: RET ;Return with error code in R) .END