View previous topic :: View next topic
|
Author |
Message |
Ashokn
New User
Joined: 25 Jun 2008 Posts: 13 Location: Bangalooru
|
|
|
|
Hi,
How to declare & initialize a hexadecimal value in pl/1?
For example: In some language:-
DEFINE ERRHEX 5 H VALUE ='1002' ;
what will be the equivalent of above statement in PL/1?
Thanks in adv... |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
You can code:
Code: |
DCL HEX_FIELD CHAR(1) INIT('05'X); |
Garry |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
I'm may be misunderstanding something, but how might "VALUE ='1002'" = "INIT('05'X)"? |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
Sorry,
Read the 5 in the post incorrectly.
Code: |
DCL HEX_FIELD CHAR(2) INIT('1002'X); |
or, for array,
Code: |
DCL HEX_FIELD(5) CHAR(2) INIT((5)'1002'X);
|
Garry. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Not a problem
Just checking to see what i might have missed. . .
Thanx for the clarification
d |
|
Back to top |
|
|
Ashokn
New User
Joined: 25 Jun 2008 Posts: 13 Location: Bangalooru
|
|
|
|
Thanks for your answers.It cleard my long awaiting doubt .
==============================================
Garry Carroll wrote: |
Sorry,
Read the 5 in the post incorrectly.
Code: |
DCL HEX_FIELD CHAR(2) INIT('1002'X); |
or, for array,
Code: |
DCL HEX_FIELD(5) CHAR(2) INIT((5)'1002'X);
|
Garry. |
|
|
Back to top |
|
|
|