[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

663.0. "SCRIPT SCRIPT not closing in FOR loop" by WARABI::ZORBAS (NULL Junior) Mon May 11 1992 05:26

    
    I am writing an ALL-IN-1 application which reformats 1000's of text
    files into WPS-PLUS.
    
    To do this I have a SCRIPT SCRIPT which calls up the document in
    WPS-PLUS, brings in a ruler then does a GOLD-T and then GOLD-ADV to
    reformat the text within the rulers. A GOLD-F completes the deed. 
    
    The problem is that this SCRIPT SCRIPT is being called from within a
    FOR loop and it appears that the file is not being closed (until I
    return to accept user input), thus I eventually blow FILLM. 
    
    Using DUMP_CACHE doesn't help.
    
    Any suggestions on how to force the files to close?
    
    	Stuart.
    
T.RTitleUserPersonal
Name
DateLines
663.1WARABI::ZORBASNULL JuniorMon May 11 1992 06:097
    
    
    <<<FOR loop and it appears that the file is not being closed (until I
    
    I should add that the file not being closed is the SCRIPT.
    
    Stuart.
663.2Need to change the algorithmSHALOT::NICODEMWho told you I&#039;m paranoid???Mon May 11 1992 16:2017
	A Script mode script file is not closed until either a specific script
directive is encountered that closes it (e.g., .EXIT, .ABORT), or until some
part of the application goes for input and encounters an EOF.  For instance, if
I have an application that requires exactly three pieces of input, and no more,
and I write a Script mode script containing that input and then run the appli-
cation, the script file will still be open.  The *next time* I need input,
though, ALL-IN-1 will go to the script file, get an end-of-file, and close the
script.  (BTW, putting a .EXIT after the third piece of input won't work either,
since it won't be encountered until the application goes back form more input.)

	So in effect, what you're doing is nesting your script files.  Each time
you go through your FOR loop and execute another SCRIPT function, you are
leaving the previous script file open -- even though it is basically at end-of-
file -- and starting a new script.  (You might try a OA$SCP_STACK_DUMP to look
at your script stack and verify this.)

	F
663.3ScripturesSNOC02::ZORBASSTUARTNULL JuniorTue May 12 1992 01:2310
    
    Frank,
    
    So, in short, you're saying "bad luck, it won't work that way".
    
    Any other suggestions?
    
    	Cheers,
    
    	Stuart 
663.4DO it all from within a single script?SHALOT::DUNCANJoe - CIS/EIC Doc. Mgmt. Solution Set ConsultantTue May 12 1992 15:554
    Why not put the for inside the script script, and not have to leave the
    script at all, until all the files have been processed?

    Joe Duncan @ OPA
663.5SNOC02::ZORBASSTUARTNULL JuniorWed May 13 1992 02:377
    
    Sounds good Joe.
    
    Unfortunately, the script is being called near the end of a long line of
    DO calls.
    
    	Stuart.
663.6Grasping at straws...SHALOT::DUNCANJoe - CIS/EIC Doc. Mgmt. Solution Set ConsultantWed May 13 1992 16:126
    Stuart,

    How about embedding the DO calls in the script script?  Do the DO
    scripts collect user input?  That could complicate things somewhat.

    Joe Duncan @ OPA
663.7Prompt?SNOC02::ZORBASSTUARTNULL JuniorFri May 15 1992 01:3911
    
    I upped all my personal quotas (including FILLM) and it made no
    difference; could be a system parameter (perhaps SRA related Joe!).
    
    Anyway, what I did was to issue a prompt every 100 transactions. This
    effectively closes the script scripts. So all I do now is start the job
    and hit RETURN a couple of hundred times and let it run...
    
    	Cheers,
    
    		Stuart
663.8PAULUS::BAUERRichard - ISE L10N Center FrankfurtWed Jul 01 1992 13:4318
    Hi !
    
    The following script worked for me, no hitting RETURN necessary:
    
oa$tra_set all,script,scrchr,symbol,mess,input,log
for cab$ with .folder eqs "TEST" THEN -
 cab select .%key:30,.%key:6:30\\-
 script testudp.scp\\edit oa$curdoc_filename,,,"WPSPLUS"\\-
 prompt\\oa$scp_stack_dump
oa$tra_set off,log
    
    This was done on V2.4. The key is to use the PROMPT as said before. The
    OA$TRA_SET are just for debugging of course, but the OA$SCP_STACK_DUMP
    shows clearly that the stacking level is lowered.
    
    Maybe it still helps
    
    	Richard