Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AS400 User Input

Status
Not open for further replies.

JamiecPBC

Technical User
Mar 9, 2020
2
US
I have minimum knowledge on how to create VBScript. I usually google search, copy and paste code and hope it works.

I'm a graphic designer and I have to create an invoice for certain signs I print.

I recorded a macro in AS400 to log me in and take me to the invoice screen.

At this point I would like to type the quantity and price of the sign.

I'm not sure how to add a user input code into the VBScript. Is this possible?

(Bold sections where I want it to open with a message box prompt)

----------------------------------------------------------------------

[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 "[enter]"

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

autECLSession.autECLPS.WaitForCursor 22,5,10000

autECLSession.autECLOIA.WaitForAppAvailable

autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "09716"
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "[tab]"
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "USER INPUT QUANTITY"
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "[tab]"
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "USER INPUT PRICE"
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "[tab]"
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "[enter]"

autECLSession.autECLPS.WaitForAttrib 9,6,"30","3c",3,10000

autECLSession.autECLPS.Wait 4025

autECLSession.autECLOIA.WaitForAppAvailable

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

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

autECLSession.autECLPS.WaitForCursor 22,5,10000

autECLSession.autECLOIA.WaitForAppAvailable

autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "00997"
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "[tab]"
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "[tab]"
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "[tab]"
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "guinness st pats"
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "[enter]"

autECLSession.autECLPS.WaitForAttrib 14,27,"00","3c",3,10000

autECLSession.autECLPS.Wait 3494

autECLSession.autECLOIA.WaitForAppAvailable

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

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

autECLSession.autECLPS.Wait 11903

autECLSession.autECLOIA.WaitForAppAvailable

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

autECLSession.autECLPS.WaitForAttrib 21,8,"00","3c",3,10000

autECLSession.autECLPS.Wait 2699

autECLSession.autECLOIA.WaitForAppAvailable

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

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

autECLSession.autECLPS.Wait 5663

autECLSession.autECLOIA.WaitForAppAvailable

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

autECLSession.autECLPS.WaitForAttrib 22,6,"00","3c",3,10000

autECLSession.autECLPS.WaitForCursor 22,7,10000

autECLSession.autECLOIA.WaitForAppAvailable

autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "dp jamiec"
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "[enter]"

autECLSession.autECLPS.WaitForAttrib 10,2,"00","3c",3,10000

autECLSession.autECLPS.WaitForCursor 10,3,10000

autECLSession.autECLOIA.WaitForAppAvailable

autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "2"
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "[enter]"

autECLSession.autECLPS.WaitForAttrib 14,36,"00","3c",3,10000

autECLSession.autECLPS.WaitForCursor 14,37,10000

autECLSession.autECLOIA.WaitForAppAvailable

autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "p00202"
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "[enter]"

autECLSession.autECLPS.WaitForAttrib 10,2,"00","3c",3,10000

autECLSession.autECLPS.WaitForCursor 10,3,10000

autECLSession.autECLOIA.WaitForAppAvailable

autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "1"
end sub
 
This isn't really a VBScripot question, it is about IBM's Host Access Class Library Automation Objects. Not sure we have any experts in here for that, nor am I quite sure whether there is a more appropriate forum on this site
 
Thanks for your help. With more some more searching I found the code that adds a user input.

From this website.
Bold sections of code to add.

sub subSub1_()
Dim strAnswer
autECLSession.autECLOIA.WaitForAppAvailable
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "[pf3]"
autECLSession.autECLPS.WaitForAttrib 22,13,"00","3c",3,10000
autECLSession.autECLPS.Wait 3088
autECLSession.autECLOIA.WaitForAppAvailable
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "[pf3]"
autECLSession.autECLPS.WaitForAttrib 4,24,"00","3c",3,10000
autECLSession.autECLPS.WaitForCursor 4,25,10000
autECLSession.autECLOIA.WaitForAppAvailable
autECLSession.autECLOIA.WaitForInputReady
strAnswer = InputBox("Please enter a Process Option:")
autECLSession.autECLPS.SendKeys strAnswer

autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "[enter]"
end sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top