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!

Attachmate and VB.NET - Option Strict ON

Status
Not open for further replies.

elfstoneUK

Programmer
Dec 6, 2004
3
GB
Hi,
I need some help with instantiating obects in EXTRA! 7.11 and VB.NET. I have been trying to use the examples in EXTRA! Enterprise (Marco Editor) help files. As suggested by the help line. The problem is that the project is running with Option Strict On (Strict type checking) but the examples given are not; it's simply VB6 code!

For example I want to check the status of the XClock. From the help files:
Code:
Dim Sys As Object
Dim Sess As Object
Dim MyScreen As Object
        ' This gets the System object
Set Sys = CreateObject("EXTRA.System")
        ' Assumes an open session
Set Sess = Sys.ActiveSession
Set MyScreen = Sess.Screen
and then I type "MyScreen.OIA.XStatus" and then build up a Select Case or If... ElseIf... End If block.

But we can't use "Set" in VB.NET. The equivalent VB.NET code, which I worked out, looks like this:
Code:
Sys = CType(CreateObject("EXTRA.System"),EXTRA.ExtraSystem)
Sess = CType(oSys.Sessions, EXTRA.ExtraSessions)
Ses=CType(oSess.Open("C:\Session1.EDP"),EXTRA.ExtraSession)
MyScreen = CType(oScr.OIA, EXTRA.ExtraScreen)
*** Remember, Option Strict is set to On ***

Does anyone know if I'm correct here?

If we type "MyScreen" then the "." we get the dropdown and can select "OIA" but if you type "." again you don't get "XStatus". What you get is "GetType" only.

So there is NO "XStatus" in the dropdown object list.

How can I get at the XClock method?

Can anyone help me here, please? :)

 
I'm not using either system you are currently, but I do know that the 6.5 object library doesn't include the "MoveTo" method. This results in similar results as that you listed above.

I get around this by explicitly referring to the object without the "." referencing my created intermediate Screen object.

With your Option Strict on, don't know of a solution. Just wanted to let you know that Attachmate has been know for this in the past.

calculus
 
Yeah, I discovered referencing the screen object by accident, it helps a bit. :)

I'm looking at converting this line now to get the status of the X-Clock:
Code:
Dim wReturn As Integer = Asc(Mid([i][b]oScr.OIA.Value[/b][/i], 90, 1))

The highlight indicates late binding (with Option Strict On) so I can't compile it in VB.NET. I need to covert it to the correct type. This is what I have come up with so far; it seems to work. But I will test it again today:

Code:
Dim wReturn As Integer = Asc(Mid(oScr.GetString, oScr.GetString.Length, 1))

Does that make sense to you?
 
My testing now shows that it doesn't have the full text lenght.
Which seems to be 103 chars on a 3270 system, rather than 80 which I get with the previous line :)

If you haven't guessed yet, this is all new to me :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top