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

Problem assigning Hex values to System.String

Status
Not open for further replies.

SCALVI

IS-IT--Management
May 21, 2001
3
IT
The following example demonstrate that moving three bytes string ( '01' '99' and '6D' ) into a System.String we lose the byte containing '99' (actually any byte with a value greather than '7F').


IDENTIFICATION DIVISION.
PROGRAM-ID. Program1 AS "Application1.Program1".
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SPECIAL-NAMES.

REPOSITORY.
CLASS CLASS-String AS "System.String".
DATA DIVISION.

WORKING-STORAGE SECTION.

01 Str-Object OBJECT REFERENCE CLASS-String.
01 Alpha-1 PIC X(3).
01 Alpha-2 PIC X(3).

PROCEDURE DIVISION.

MOVE X'05996D' TO Alpha-1

SET Str-Object TO X'05996D'
SET Alpha-2 TO Str-Object

END PROGRAM Program1.
 
Have you tried the following:

MOVE X'05996D' TO Alpha-2.

Not sure why you are going through the Str-Object.

etom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top