Tip

Hex characters in Client Access

If you know the EBCDIC value for any character, you can enter it using this macro. The PC5250 emulation in Client Access and Personal Communications does not have a Hex function that can be mapped to the keyboard. This function existed on the 5250 keyboards, and this macro gives the user the same ability, viz., to enter any character between x40 and xFE, either by entering the decimal value 64 -254, or the hex value, x40 - xfe, either upper or lowercase.


  
LANGUAGE=VBSCRIPT
[PCOMM SCRIPT HEADER]
LANGUAGE = VBSCRIPT
DESCRIPTION=Hex input
[PCOMM SCRIPT SOURCE]

Option Explicit

Dim input_value, hex_value

autECLSession.SetConnectionByName (ThisSessionName)

subHex_

Sub subHex_()
input_value = InputBox("Enter a decimal number between 64 and 254, or a hex value between x40 and xFE (either uppercase or lowercase")

If input_value = "" Then
     MsgBox ("invalid input")
     Exit Sub

ElseIf (IsNumeric(input_value) Or _
         (Len(Trim(input_value)) = 3 And _
          UCase(Left(input_value, 1)) = "X") And _
          IsNumeric("&H" & Mid(input_value, 2, 2))) Then

     If (UCase(Left(input_value, 1)) = "X") Then
         input_value = "&h" & Mid(input_value, 2, 2)
     End If

     If (input_value >= 64 And input_value <= 254) Then
         hex_value = Hex(input_value)

     Else
         MsgBox ("value '" & input_value & "' out of range")
         Exit Sub
     End If

Else
     MsgBox ("non numeric input '" & input_value & "'")
     Exit Sub
End If

autECLMacro "apl " & Hex(input_value)
End Sub 

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: tips, tutorials and more.

Ask your programming questions--or help out your peers by answering them--in our live discussion forums.

Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.

This was first published in April 2002

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.