|
-
Nov 12th, 2007, 08:59 PM
#1
Thread Starter
New Member
On error code
Hello all. I am having a problem. I need an on error code for my macro below. The coding below is designed to find IA on screen, once it's found it should go to .FoundTextRow column 3. but if it is not found on the screen then I need it to .TransmitTerminalKey rcIBMreset key and continue. Any suggestions?
Right now, it errors out on runtime error 4132.
displayText = Session.FindText("IA", 8, 75)
.SetMousePos .FoundTextRow, 3
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.TransmitANSI "x"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 20, 41
.WaitForDisplayString "Action:", "30", 20, 33
.TransmitANSI "accomplete"
.TransmitTerminalKey rcIBMEnterKey
Thanks in advance.
-
Nov 12th, 2007, 09:03 PM
#2
Re: On error code
Welcome to the Forums.
Is this in VB 6 or something else? Are you using some control as "Session" is not a native VB 6 object. Are you automating a Terminal Emulation program or ???
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 12th, 2007, 09:07 PM
#3
Thread Starter
New Member
Re: On error code
Well, it is VB 6.3 and it is for AS400 Reflections.
-
Nov 12th, 2007, 10:34 PM
#4
Re: On error code

VB 6.3 is VBA and so I've move your thread to here.
-
Nov 13th, 2007, 05:51 AM
#5
Re: On error code
What are the return possibilities of displayText ?
Not sure if it supports Len but its a basic in VBA so it should. It will test the length of the value in the variable - displayText.
Code:
displayText = Session.FindText("IA", 8, 75)
If Len(displayText) = 0 Then
'Not found
.TransmitTerminalKey rcIBMreset
Else
.SetMousePos .FoundTextRow, 3
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.TransmitANSI "x"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 20, 41
.WaitForDisplayString "Action:", "30", 20, 33
.TransmitANSI "accomplete"
.TransmitTerminalKey rcIBMEnterKey
End If
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|