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

Screen Message 1

Status
Not open for further replies.

savagexi

Programmer
Dec 9, 2004
1
GB
Can someone help with screen errors?

I have created a macro which goes through different screens but the problem is that sometimes these screen change slightly or options taken away. What I need is create a generic error routine. What I want is for the macro to stop if the next screen is not displayed without having to always check screen names.

For example if there is 4 options numbered 1 to 4 and you send key 5 (5 has been taken away), a message displays saying 5 is not a valid option. The macro continues running and all the keystrokes get out of sync.

Can anyone help with this?
 
You have to make sure that the macro is always where it is supposed to be. I use this code where I just want to wait for the screen to change:

Do while Sess0.Screen.OIA.Xstatus <> 0
Doevents
Loop

In the example you gave above, you'll have to make sure that option 5 is valid before sending the keys. You may want to check my FAQ for some helpful ways to do this, but the getstring method would work well here.

You'd get the string where option "5" was supposed to be. If it's not there, then tell the user and cancel. Alternately you could use a "failed" routine that says enter the "5", then if you get an error message tell the user and exit sub.

I'm ready for Extra Basic... now what? faq99-4087

calculus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top