$ VERIFY = 'F$VERIFY("NO")' $ ON CONTROL_Y THEN EXIT %X10000004 $!----------------------------------------------------------------------------- $! OFFLOAD.GET - The function of this command procedure is to fetch a list $! of file name and return this list in the global symbol passed. $! $! P1 - contains the name of the global symbol to return the list of $! file names in. $! P2 - contains the prompt line. $! P3 - contains the default directory. $! P4 - contains a flag. $! "DISK" --- include disk device names with files specs. $! "NODISK" - Do NOT include disk device names with file specs. $! P5 - contains a flag. $! "DEFAULTS" --- allow defaults to come from the previous file $! "NODEFAULTS" - do NOT allow defaults. $!----------------------------------------------------------------------------- $! 25-Aug-1982 R. A. Harris Modify to use new V3.0 lexical functions in $! stead of the FD program. $! 07-Mar-1983 R. A. Harris Modify the F$PARSE to not care about whether $! the directory already exists or not. $!----------------------------------------------------------------------------- $! $ OFFLOAD_FILES := "" $ first := yes $ OFFLOAD_DIR := 'P3' $ last_dd = f$parse(p3) - ".;" $ wild_card := no $ W := WRITE SYS$OUTPUT $! $! Build the prompt string. $! $ def_dir_spec = last_dd $ if p4 .eqs. "NODISK" then - def_dir_spec = def_dir_spec - f$parse(def_dir_spec,,,"device") $ PROMPT := "''P2' (default is ''def_dir_spec'*.*;*)" $! $! Prompt for the file(s) to offload. $! $ PROMPT_OFFLOAD_FILE: $ ON ERROR THEN EXIT $STATUS $! $! Display the files already selected. $! $ W " " $ if .not. first then - @offload_dir:OFFLOAD.PUT SYS$OUTPUT " " "''OFFLOAD_FILES'" $! $! Prompt for the next file to offload. $! $ W " " $ def_dir_spec = last_dd $ if p4 .eqs. "NODISK" then - def_dir_spec = def_dir_spec - f$parse(def_dir_spec,,,"device") $ w "Assumed directory = ''def_dir_spec'" $ INQUIRE FILE "''PROMPT'" $! $! Change prompt to remove default and tell how to terminate. $! $ PROMPT := "''P2' ( to end)" $! $! Check for default selected or if end of specification loop. $! $ IF FILE .EQS. "" .AND. first THEN FILE := *.*;* $ IF FILE .EQS. "" THEN GOTO ENDDO_GET_FILES $! $! Parse the file specified, check for syntax errors, apply defaults $! $ ON WARNING THEN GOTO PROMPT_OFFLOAD_FILE $ fd_device = f$parse(file,"*.*;*",last_dd,"device") $ fd_directory = f$parse(file,"*.*;*",last_dd,"directory") $ fd_file = f$parse(file,"*.*;*",last_dd,"name") - + f$parse(file,"*.*;*",last_dd,"type") - + f$parse(file,"*.*;*",last_dd,"version") $ if fd_device .nes. "" .and. - fd_directory .nes. "" .and. - fd_file .nes. "" then goto endif_parse_error $ write sys$error - "%IPSS$OFFLOAD-E-FILEERR, File name parsing error" $ goto prompt_offload_file $ endif_parse_error: $! $ fd_n = fd_device + fd_directory + fd_file $ tmp = fd_device + fd_directory $ if tmp .eqs. last_dd .and. - p5 .eqs. "DEFAULTS" .and. - .not. wild_card .and. - .not. first then - fd_n = fd_n - tmp $ l = f$length(tmp) $ wild_card := no $ if ( f$locate("*",tmp) .ne. l .or. - f$locate("%",tmp) .ne. l .or. - f$locate("...",tmp) .ne. l ) then wild_card := yes $ if .not. wild_card then last_dd = tmp $! $ if p4 .eqs. "NODISK" then - fd_n = fd_n - f$parse(fd_n,,,"device") $! $ IF 'F$LENGTH(OFFLOAD_FILES)' + 'F$LENGTH(FD_N)' .LE. 180 THEN - GOTO ENDIF_TOO_MANY_FILES $ WRITE SYS$ERROR - "%IPSS$OFFLOAD-E-TOOMANYFILES, to many file names specified." $ GOTO PROMPT_OFFLOAD_FILE $ ENDIF_TOO_MANY_FILES: $! $ OFFLOAD_FILES := "''OFFLOAD_FILES'''FD_N',-" $ ON ERROR THEN EXIT $STATUS $! $ first := no $ GOTO PROMPT_OFFLOAD_FILE $ ENDDO_GET_FILES: $! $! Store the files in the global symbol name passed. $! $ 'P1' :== "''OFFLOAD_FILES'" $! $! Exit. $! $ EXIT: $ IF VERIFY THEN SET VERIFY !'F$VERIFY("NO")'