×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

AS400 User Input

AS400 User Input

AS400 User Input

(OP)
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 "    "
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "USER INPUT QUANTITY"
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "    "
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "USER INPUT PRICE"
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "    "
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 "    "
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "    "
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "    "
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

RE: AS400 User Input

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

RE: AS400 User Input

You could try InputBox

RE: AS400 User Input

(OP)
Thanks for your help. With more some more searching I found the code that adds a user input.

From this website. https://www.tetcommunity.com/blogs/macros-in-ibm-p...

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close