Help:corrupted text after GetText (VBA)



Post anything related to mainframes (IBM & UNISYS) if not fit in any of the above categories

Help:corrupted text after GetText (VBA)

Postby st213497 » Thu Sep 12, 2013 6:04 pm

Dears,
I am trying to screen scrape the text from the mainframe to excel using excel VBA. The code gets the data but when i insert in cells, the data is corrupted because the screen text language is Arabic.
I tried to copy the screen of the main frame manually using Edit -> select All then Edit -> copy and paste in excel and it worked correctly. I need to send the (select all) and (copy) commands from excel VBA.

My Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Dim autECLPSObj As Object
   
    Set autECLPSObj = CreateObject("PCOMM.autECLPS")
    autECLPSObj.SetConnectionByName ("A")
   
    Dim feedback As String
    feedback = ""
    feedback = RTrim(autECLPSObj.GetText(1, 1, 220))
    MsgBox feedback
End Sub
You do not have the required permissions to view the files attached to this post.
st213497
 
Posts: 2
Joined: Thu Sep 12, 2013 5:46 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Help:corrupted text after GetText (VBA)

Postby dick scherrer » Thu Sep 12, 2013 7:47 pm

Hello and welcome to the forum,

You would probably get some responses if you posted in a forum that handles VBA.

A few of our members use VBA, but we do not have a part of the forum for this.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Help:corrupted text after GetText (VBA)

Postby st213497 » Thu Sep 12, 2013 7:59 pm

Thank you for your prompt reply.

I wish those who work on VBA to help me.
st213497
 
Posts: 2
Joined: Thu Sep 12, 2013 5:46 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Help:corrupted text after GetText (VBA)

Postby NicC » Thu Sep 12, 2013 8:22 pm

You will probably get better help from an Excel forum. It is probably something within VBA but I am just starting out on this VBA road and have neither arabic green screen or arabic excel! as I expect would be the case with most mainframers here.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Help:corrupted text after GetText (VBA)

Postby Ed Goodman » Fri Sep 13, 2013 12:40 am

Lost my reply for waiting too long to click submit...

Are you saying that when you use the windows cut/paste, it translates Arabic to something else? Or are you just saying that the Arabic copies correctly as Arabic when you do that?

Is the Arabic code page a double-byte character set?
Ed Goodman
 
Posts: 341
Joined: Thu Feb 24, 2011 12:05 am
Has thanked: 3 times
Been thanked: 17 times

Re: Help:corrupted text after GetText (VBA)

Postby Ed Goodman » Fri Sep 13, 2013 1:29 am

I found this:
http://publib.boulder.ibm.com/infocente ... ming08.htm

It's what i use when playing with HLLAPI.

Function 34 (Copy field to string) has this note:
The Copy Field to String function translates the characters in the host source presentation space into American National Standard Code for Information Interchange (ASCII). Attribute bytes and other characters not represented in ASCII normally are translated into blanks.

Another note reads:
The string containing the Unicode characters to be sent to the PCOMM session should be typecast to WCHAR * for code page 1390/1399 and to char * for code page 1137.
Ed Goodman
 
Posts: 341
Joined: Thu Feb 24, 2011 12:05 am
Has thanked: 3 times
Been thanked: 17 times


Return to All other Mainframe Topics

 


  • Related topics
    Replies
    Views
    Last post