Results 1 to 9 of 9
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    know when the job of print is finished? (2000 sr.1)

    ...another application make for me a print job in a file, for me is important to be sure whe the job of print is finished, only in this mode i am sure to take the all data from this file from a macro...

    the possibilty of print job are only 2 case.

    1.case) the print of file is finisched when in the bottom of this is present:

    ***** F I N E S T A M P A *****


    2.case) the print of file is finisched when in the bottom of this is present:

    87/87

    in this case when the number of page first/last is equal the job is finisched...


    my idea is to make a scroll from a cursor during the print and when this find the first or
    the second case this queue of print is finished


    Please make 2 separate macro for separate case...
    Or have you another ideas????
    Tks...

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: know when the job of print is finished? (2000 sr.1)

    Added warning: this probably won't work. Chances are that the print-to-file job opens the file exclusively, so you can't open it to test. Conversely, if you succeed in opening the file before the print job has finished, you will lock it for writing, so the print job will abort.

    <img src=/w3timages/blueline.gif width=33% height=2>

    Sal, I have attached a text file with two functions, FINESTAMPA and FinalPage. You can copy the code into a module. Use it as follows:

    To check if the file C:L0785.txt is finished (contains *** FINE STAMPA ***), test

    If FINESTAMPA("C:L0785.txt") = True Then
    ' code to process the file goes here
    End If

    or

    If FINESTAMPA("C:L0785.txt") = False Then
    MsgBox "File not ready yet.", vbInformation
    Exit Sub
    End If

    Similarly, to test if the file ends with something like 091/091, use

    If FinalPage("C:L0785.txt") = True Then
    ...

    Make sure to provide the correct path and file name.

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: know when the job of print is finished? (2000 sr.1)

    tks HansV but the 3/6 and 4/6 i am in vacation time, i test your script in moonday in my office I am sure that code work fine....

  4. #4
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: know when the job of print is finished? (2000 sr.1)

    my dear have you understand Mytichs...? i have explain in a old post.

  5. #5
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: know when the job of print is finished? (2000 sr.1)

    my dear i have see the file maj

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: know when the job of print is finished? (2000 sr.1)

    I understand what the code intends to do, but I don't understand how to make it run.
    A) The CICS procedure creates a text file.
    [img]/forums/images/smilies/cool.gif[/img] A batch file copies the text file to another folder.
    C) A loop waits until the file in the other folder exists.
    Since you don't know when the output has finished, I don't understand when to run the batch file. You should ask your friend to explain.

  7. #7
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: know when the job of print is finished? (2000 sr.1)

    OK! YOU HAVE UNDERSTAND! Mytichs....
    I phone my friend for your question and after i tell you...

  8. #8
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: know when the job of print is finished? (2000 sr.1)

    after when i click on button to start the job...

    i my case the command to start the print job is in this line:

    Sess0.SCREEN.PUTSTRING "9999", 10, 42
    Sess0.SCREEN.PUTSTRING " ", 11, 42
    Sess0.SCREEN.PUTSTRING codprint, 15, 42

    after this line start the job
    Sess0.SCREEN.SendKeys ("<Enter>" + "<Enter>")

    Sess0.SCREEN.waitforstring "TRASMESSA", 1, 28, 9
    Sess0.SCREEN.SendKeys ("<PF3>")
    Sess0.SCREEN.waitforstring "L0785", 3, 2
    Sess0.SCREEN.SendKeys ("<PF3>")
    Sess0.SCREEN.waitforstring "L0785", 5, 13
    Sess0.SCREEN.SendKeys ("<PF3>")

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: know when the job of print is finished? (2000 sr.1)

    I don't think we can help you with this, Sal. Since your friend knows how the system works, he's the one to assist you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •