×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*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.

# AttachMate solutions FAQ

 Forum Search FAQs Links MVPs

## Extra Basic Starter Functions

 I'm ready for Extra Basic... now what? by calculus faq99-4087 Posted: 29 Aug 03 This question gets asked occasionally, so I thought I'd share a list of 10 functions I teach in my beginning Extra Basic Macro course. While this is not a comprehensive, or even deep list, it will get most people started in programming in Extra Basic.Above all, look in the help files. Every version of Extra that I've used has very informative help files. You can usually even find a comprehensive list of methods and functions.calculus1. SENDKEYSDefinition: Types the desired keys in Extra at the current cursor location. The keys to be sent are a STRING and should be put in parenthesis (ôö). Special keys listed inside the parenthesis should also be in pacmen (<>). A list of special keys can be found in the help files of Extra Basic.Use: Sess0.Screen.SendKeys(STRING)Examples:Sess0.Screen.SendKeys (ôhstqö)Sess0.Screen.SendKeys (ôhstqö)Sess0.Screen.SendKeys (ôhstqö)2. WaitHostQuietDefinition: Waits for the specified amount of time to elapse. The NUMBER is in milliseconds (i.e. 3000 = 3 seconds).Use: Sess0.Screen.WaitHostQuiet (SettleTime)Example: Sess0.Screen.WaitHostQuiet (500)3. Understanding Screen PositionThe Extra screen is defined by rows and columns. As a programmer, you can use the Row and Column position to tell the computer where to get data from, or where to send data to. Additionally, you donÆt have to count the rows and columns. The system constantly keeps track of where your cursor is with screen coordinates in the bottom right hand corner of the screen. In this example, the Row is 24 and the Column is 71.4. MoveToDefinition: Used to move the cursor to a specific location on the screen.Use: Sess0.Screen.MoveTo ROW, COLExample:Row = 11Col = 76Sess0.Screen.MoveTo 11, 765. WaitForStringDefinition: Stops macro playback until the desired STRING is found. Row and Col are optional. If not given, the program will look for the string across the entire screen.After 30 seconds or so the macro will start back regardless. This is called a Time Out.Use: Sess0.Screen.WaitForString STRING, Row, ColExample: Sess0.Screen.WaitForString "CICS", 1, 73 6. GetStringDefinition: Used to get data from the screen. This function will store the data in a variable for later use. A typical use would be to get a KLN, change screens and use the KLN for a new query. You must tell the system the location by row, column. You must also tell the system how many characters youÆd like returned (i.e. the length of the STRING youÆre getting).Use: VARIABLE_NAME = Sess0.Screen.GetString (Row, Col, String Length)Example: Row = 10Col = 7Length = 6 (6 Characters ô135343ö)KLN = Sess0.Screen.GetString (10,7,6) 7. PutStringDefinition: Used to put a STRING to a specific location on the screen. This can be a variable youÆve previously gotten using a GETSTRING function, or a specific string you want to send to a certain location. This is helpful if you need to send ôqö to PID for an item query, or in the example to the right, ôBö to the type field.Use: Sess0.Screen.PutString STRING, Row, ColExample: Row = 2Col = 11STRING = KLN from previous exampleSess0.Screen.PutString KLN, 2,11OrSess0.Screen.PutString ô135343ö, 2,11OrSess0.Screen.PutString ôbö, 3,118. MsgBoxDefinition: Used to display information to the user.Use: Msgbox STRING Example: Msgbox ôMacro Finishedö9. InputBoxDefinition: Used to query the user and ask for input.Use: VARIABLE_NAME = Inputbox STRINGExample: UserResponse = InputBox (ôHow did you like classö)10. RemarksDefinition: Used to disable certain lines of code without erasing them.Use: REM at the front of the line of codeOræ at the front of the line of codeExample:Rem Msgbox ôMacro FinishedöOræMsgbox ôMacro Finishedö Back to AttachMate solutions FAQ Index Back to AttachMate solutions Forum

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:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!