[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference iosg::all-in-1_v30

Title:*OLD* ALL-IN-1 (tm) Support Conference
Notice:Closed - See Note 4331.l to move to IOSG::ALL-IN-1
Moderator:IOSG::PYE
Created:Thu Jan 30 1992
Last Modified:Tue Jan 23 1996
Last Successful Update:Fri Jun 06 1997
Number of topics:4343
Total number of notes:18308

1608.0. "COPY in a FOR loop problem" by KAOFS::D_STREET () Wed Oct 14 1992 01:15

    Hello,
     I have a client who would like to get the following command to work in
    a FOR loop, and is having trouble.
    
    	COPY "@OA$CURDOC" "sys$login:test.txt"
    
     They start the thing off with a COM file as follows:
    
    $allin1/noinit
    oa$ini_init
    DO test_script_1.scp
    .EXIT
    
     TEST_SCRIPT_1.SCP is in the persons ALL-IN-1 directory, and looks
    like:
    
    FOR CAB$ WITH .folder EQS "MDA-ARCHIVE" DO .text oa$curdoc_title
    !			(this actually displays all the titles)
    FOR CAB$ WITH .folder EQS "MDA-ARCHIVE" DO DO test_script_2.scp
    
    TEST_SCRIPT_2.SCP exists, and looks like:
    
    make_file_name /nocheck #clean_title,oa$curdoc_title
    get #out_filename=#clean_title ".TXT"
    copy "@oa$curdoc" #out_filename
    
     The result ia an error message:
    
    %oa-e-nocopy, Problem with COPY function - file "@oa$curdoc"
    
     Could someone suggest why it won't work, or even better, a way that
    will work?
    
    					Thanks
    					Derek Street.
T.RTitleUserPersonal
Name
DateLines
1608.1SIOG::T_REDMONDThoughts of an Idle MindWed Oct 14 1992 12:039
    They may be losing context as they process the different documents.
    Tell them to use CABINET NEXT_DOCUMENT to select each document in the
    folder (in turn), checking OA$STATUS to know when they've reached the
    end of the folder. As each document is selected they should find that
    OA$CURDOC is correctly updated and is usable.  If they aren't
    processing mail messages they can use OA$CURDOC_FILENAME instead of
    "@OA$CURDOC".
    
    Tony
1608.2working script to copy all docsKAOFS::D_STREETWed Oct 14 1992 17:0918
    Thanks Tony for the advice. Here is what I ended up with.
    
    text "test script 1"
    FOR CAB$ WITH .folder EQS "COPY" DO .TEXT oa$curdoc_title " " oa$curdoc
    !
    get #folder = "COPY"
    .LABEL loop
            CAB NEXT_DOCUMENT #folder,#folder
            .IF OA$STATUS EQ 0 THEN .GOTO done
            .text "oa$curdoc_title = " oa$curdoc_title
            .text "oa$curdoc       = " oa$curdoc
            make_file_name #clean_title,oa$curdoc_title
            GET #out_filename=#clean_title ".TXT"
            .text "outfile name    = " #out_filename
            COPY "@oa$curdoc" #out_filename
            .GOTO loop
    .LABEL done
    .text "End script 1"