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

Minimun code

Status
Not open for further replies.

DarronWindrunner

Programmer
Nov 15, 2003
4
GB
Hello!

Ive recently started to mess about with EXTRA basic, to try and make things in work a bit easier.

When writing a macro to affect anything on screen (ie goto a certain row, or take a value from the screen, or anything)

There are a certian set of commands that need to be in the macro so it knows where to look i assume, in this case the active session.

I dont know how to code this as im only starting out. The only way i can get my macro to work is to record a macro and copy and paste what i call the 'generic' code.

The code involves commands like Get active session i think. Basicly the question is what is the minnimum code needed for a basic query that affects the session you have active.

I hope that makes sence
 
Here is what I use. You can get buy without the "If" statements, but they are useful in making sure a session is open.

Set System = CreateObject("EXTRA.System") ' Gets the system object
If (System Is Nothing) Then MsgBox "Could not create the EXTRA System object. Stopping macro playback.": Stop
Set Sessions = System.Sessions
If (Sessions Is Nothing) Then: MsgBox "Could not create the Sessions collection object. Stopping macro playback.": Stop
Set Sess0 = System.ActiveSession
If (Sess0 Is Nothing) Then MsgBox "Could not create the Session object. Stopping macro playback.": Stop



These lines set up the Screen object. This object then has methods and properties you can use, so no other pointing or coding is necessary. You may want to check my FAQ:

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

calculus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top