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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AS/400 Macro to Auto Fill Text Fields

Status
Not open for further replies.

basicallychels

IS-IT--Management
Jun 12, 2015
3
0
0
US
Forgive my newbieness, but I am trying to make my workday more efficient and am pretty new to scripting macros!
I would like to create two separate macros that would autofill text fields I use every time. I would like to be able to use a keyboard shortcut to run the macros. I have attached two screen shots of the ones I am trying to create a macro for, the yellow boxes show the text I would like each macro to produce. I would really appreciate any help. I believe once I see how to set these two up, I will be able to do others on my own.
 
 http://files.engineering.com/getfile.aspx?folder=acdecb17-cfdd-4162-bc41-73b69a01a1e0&file=Capture.JPG
Hi,

It seems you're using a terminal emulator, like Attachmate Extra or something else.

This is not a Visual BASIC script, but a BASIC within the emulator.

So what emulator are you using?
 
Hi
I think that I can help you. But, I need more details about the fields that you want to autofill. When cursor is in the field, appear in the bottom of page the numbers as “02/014” or “20/32”.
I need what you want to input in every field like: in the first screen capture that you send, the text “IVINSERT” will fill in the field that have numbers?? (4,47)?
In better wise, take a look for this example in next lines. Copy text, open a notepad editor, and save with extension “.mac”, I think that will run.

‘*********************************
[PCOMM SCRIPT HEADER]
LANGUAGE=VBSCRIPT
DESCRIPTION= SCREEN PHOES TEST
[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 "IVINSERT"
autECLSession.autECLOIA.WaitForAppAvailable
autECLSession.autECLPS.SendKeys "[field+]"
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLOIA.WaitForAppAvailable
autECLSession.autECLPS.SendKeys "IV"
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "[field+]"
autECLSession.autECLOIA.WaitForAppAvailable


end sub

If you know were begin de field to fill, you can use this option:
‘*********************************
[PCOMM SCRIPT HEADER]
LANGUAGE=VBSCRIPT
DESCRIPTION= SCREEN PHOES TEST
[PCOMM SCRIPT SOURCE]
OPTION EXPLICIT
autECLSession.SetConnectionByName(ThisSessionName)

REM This line calls the macro subroutine
subSub1_

sub subSub1_()
autECLSession.autECLOIA.WaitForAppAvailable
autECLSession.autECLPS.SetCursorPos 4,47 ‘Numbers must be as appear on bottom page right side in the first place to insert text.
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys “IVINSERT”
autECLSession.autECLPS.SendKeys "[field+]"
autECLSession.autECLOIA.WaitForAppAvailable
autECLSession.autECLPS.SetCursorPos 4,57 ‘Numbers must be as appear on bottom page right side in the first place to insert text.
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys “IV”
autECLSession.autECLPS.SendKeys "[field+]"


End Sub
‘*********************************

I Work with AS400/IBM Emulator (iSeries), and the macros are made from this way.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top