VB Script Question - IBM AS400

This is a discussion on VB Script Question - IBM AS400 ; Can someone help me with this script? I want to add commands to the end of the script to open a word document named "template" in the root directory. I want to select and copy the contents of the as400 ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: VB Script Question

  1. VB Script Question

    Can someone help me with this script? I want to add commands to the
    end of the script to open a word document named "template" in the root
    directory. I want to select and copy the contents of the as400 screen
    and paste it into the word document.

    Or if it would be easier to export it to a text file.


    [PCOMM SCRIPT HEADER]
    LANGUAGE=VBSCRIPT
    DESCRIPTION=
    [PCOMM SCRIPT SOURCE]
    OPTION EXPLICIT
    autECLSession.SetConnectionByName(ThisSessionName)

    REM This line calls the macro subroutine
    subSub1_

    sub subSub1_()
    autECLSession.autECLOIA.WaitForAppAvailable

    autECLSession.autECLOIA.WaitForInputReady
    autECLSession.autECLPS.SendKeys "[pf1]"

    autECLSession.autECLPS.WaitForAttrib 4,19,"00","3c",3,10000

    autECLSession.autECLPS.WaitForCursor 4,20,10000

    autECLSession.autECLOIA.WaitForAppAvailable

    autECLSession.autECLOIA.WaitForInputReady
    autECLSession.autECLPS.SendKeys "test"
    autECLSession.autECLOIA.WaitForInputReady
    autECLSession.autECLPS.SendKeys "[enter]"
    end sub


  2. Re: VB Script Question

    il 31/07/2007 16.36, Scrive bgreer5050@yahoo.com 38277048:
    > Can someone help me with this script? I want to add commands to the
    > end of the script to open a word document named "template" in the root
    > directory. I want to select and copy the contents of the as400 screen
    > and paste it into the word document.
    >
    > Or if it would be easier to export it to a text file.
    >
    >
    > [PCOMM SCRIPT HEADER]
    > LANGUAGE=VBSCRIPT
    > DESCRIPTION=
    > [PCOMM SCRIPT SOURCE]
    > OPTION EXPLICIT
    > autECLSession.SetConnectionByName(ThisSessionName)
    >
    > REM This line calls the macro subroutine
    > subSub1_
    >
    > sub subSub1_()
    > autECLSession.autECLOIA.WaitForAppAvailable
    >
    > autECLSession.autECLOIA.WaitForInputReady
    > autECLSession.autECLPS.SendKeys "[pf1]"
    >
    > autECLSession.autECLPS.WaitForAttrib 4,19,"00","3c",3,10000
    >
    > autECLSession.autECLPS.WaitForCursor 4,20,10000
    >
    > autECLSession.autECLOIA.WaitForAppAvailable
    >
    > autECLSession.autECLOIA.WaitForInputReady
    > autECLSession.autECLPS.SendKeys "test"
    > autECLSession.autECLOIA.WaitForInputReady
    > autECLSession.autECLPS.SendKeys "[enter]"
    > end sub
    >

    this sub actually copy to the clipboard from the current cursor position
    up to the first blank character, you can easyly modify looping through
    screen rows:

    sub maVai_()
    dim curcol, currow, maxcol, cval
    autECLSession.autECLOIA.WaitForAppAvailable
    curcol = autECLSession.autECLPS.CursorPosCol
    currow = autECLSession.autECLPS.CursorPosRow
    maxcol = autECLSession.autECLPS.NumCols
    do
    if (curcol > maxcol) then
    exit do
    end if
    cval = autECLSession.autECLPS.GetText(currow , curcol, 1)
    if (cval = " ") then
    exit do
    end if
    autECLMacro "[mark right]"
    curcol = curcol + 1
    loop
    autECLMacro "[edit-copy]"
    end sub

    I don't know if a window session object is available inside pcom to
    execute a word object put focus on and then paste.
    --
    Dr.Ugo Gagliardelli,Modena,ItalyCertifiedUindoscrasherAñe joAlcoolInside
    Spaccamaroni andate a cagare/Spammers not welcome/Spammers vão à merda
    Spamers iros a la mierda/Spamers allez vous faire foutre/Spammers loop
    schijten/Spammers macht Euch vom Acker/Spamerzy wypierdalac'

  3. Re: VB Script Question

    On Jul 31, 12:29 pm, "Dr.UgoGagliardelli"
    wrote:
    > il 31/07/2007 16.36, Scrive bgreer5...@yahoo.com 38277048:
    >
    >
    >
    > > Can someone help me with this script? I want to add commands to the
    > > end of the script to open a word document named "template" in the root
    > > directory. I want to select and copy the contents of the as400 screen
    > > and paste it into the word document.

    >
    > > Or if it would be easier to export it to a text file.

    >
    > > [PCOMM SCRIPT HEADER]
    > > LANGUAGE=VBSCRIPT
    > > DESCRIPTION=
    > > [PCOMM SCRIPT SOURCE]
    > > OPTION EXPLICIT
    > > autECLSession.SetConnectionByName(ThisSessionName)

    >
    > > REM This line calls the macro subroutine
    > > subSub1_

    >
    > > sub subSub1_()
    > > autECLSession.autECLOIA.WaitForAppAvailable

    >
    > > autECLSession.autECLOIA.WaitForInputReady
    > > autECLSession.autECLPS.SendKeys "[pf1]"

    >
    > > autECLSession.autECLPS.WaitForAttrib 4,19,"00","3c",3,10000

    >
    > > autECLSession.autECLPS.WaitForCursor 4,20,10000

    >
    > > autECLSession.autECLOIA.WaitForAppAvailable

    >
    > > autECLSession.autECLOIA.WaitForInputReady
    > > autECLSession.autECLPS.SendKeys "test"
    > > autECLSession.autECLOIA.WaitForInputReady
    > > autECLSession.autECLPS.SendKeys "[enter]"
    > > end sub

    >
    > this sub actually copy to the clipboard from the current cursor position
    > up to the first blank character, you can easyly modify looping through
    > screen rows:
    >
    > sub maVai_()
    > dim curcol, currow, maxcol, cval
    > autECLSession.autECLOIA.WaitForAppAvailable
    > curcol = autECLSession.autECLPS.CursorPosCol
    > currow = autECLSession.autECLPS.CursorPosRow
    > maxcol = autECLSession.autECLPS.NumCols
    > do
    > if (curcol > maxcol) then
    > exit do
    > end if
    > cval = autECLSession.autECLPS.GetText(currow , curcol, 1)
    > if (cval = " ") then
    > exit do
    > end if
    > autECLMacro "[mark right]"
    > curcol = curcol + 1
    > loop
    > autECLMacro "[edit-copy]"
    > end sub
    >
    > I don't know if a window session object is available inside pcom to
    > execute a word object put focus on and then paste.
    > --
    > Dr.Ugo Gagliardelli,Modena,ItalyCertifiedUindoscrasherAñe joAlcoolInside
    > Spaccamaroni andate a cagare/Spammers not welcome/Spammers vão à merda
    > Spamers iros a la mierda/Spamers allez vous faire foutre/Spammers loop
    > schijten/Spammers macht Euch vom Acker/Spamerzy wypierdalac'- Hide quotedtext -
    >
    > - Show quoted text -


    Thank you very much!


+ Reply to Thread