Author |
Message
|
venky |
Posted: Tue Oct 26, 2004 7:26 am Post subject: Looping hexadecimal values |
|
|
 Master
Joined: 08 Jul 2003 Posts: 205
|
Hi All,
Can we run a while loop for hexadecimal values.
ie.., starting from X'80' to X'FF'.
incrementing the looping value by 1 ( hex value ).
Iam having problems with incrementing the value by 1 Hex value.
Thanks,
Venky
-- |
|
Back to top |
|
 |
RocknRambo |
Posted: Tue Oct 26, 2004 8:20 am Post subject: |
|
|
Partisan
Joined: 24 Sep 2003 Posts: 355
|
can elborate ur scenario to achieve,
I mean incrementing the Hex value...?? so for initializing what the datatype r u declaring ??
probably there wud b a better way if u can explain the scenario to achieve?
-RR |
|
Back to top |
|
 |
venky |
Posted: Tue Oct 26, 2004 10:49 am Post subject: |
|
|
 Master
Joined: 08 Jul 2003 Posts: 205
|
hi RR,
This is a piece of code I have.
DECLARE Start_char INTEGER;
DECLARE end_char INTEGER;
SET Start_char = X'80';
SET End_char = X'FF';
WHILE ( Start_char <= End_char ) DO
--Do Something.
SET Start_char = Start_char + X'01';
END WHILE;
Iam trying to Loop through the Hexadecimal values which are between X'80' and X'FF'
I don't know if I can acheive the above, if anyone of you have come across such situation, please share .....
Thanks,
Venky
-- |
|
Back to top |
|
 |
RocknRambo |
Posted: Tue Oct 26, 2004 11:01 am Post subject: |
|
|
Partisan
Joined: 24 Sep 2003 Posts: 355
|
First thing...
U cannot declare variable as INT and assign...hex value.
and I dont think so...u can increment a hex value..in ESQL...
but what z ur scenario???..probably we handle in diff way.
-RR |
|
Back to top |
|
 |
siliconfish |
Posted: Tue Oct 26, 2004 12:58 pm Post subject: |
|
|
 Master
Joined: 12 Aug 2002 Posts: 203 Location: USA
|
Try this :
DECLARE start_char INTEGER;
DECLARE end_char INTEGER;
SET start_char = 0x80;
SET end_char = 0xFF;
WHILE ( start_char <= end_char ) DO
--Do Something.
SET start_char = start_char + 0x01;
END WHILE; _________________ siliconfish |
|
Back to top |
|
 |
|