× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 2011/8/4 11:37 AM, John Yeung wrote:
On Thu, Aug 4, 2011 at 10:51 AM, John McKee<jmmckee@xxxxxxxxxxxxxx> wrote:
... So,
instead of two bytes containing F5F6 (zoned), a single byte
with 56 (no zones).
Ah, so what you want to do is convert the integer value to a (hex)
byte. Just create a data structure with a 3-digit unsigned integer
(data type 'U') and an overlaid single character. Put your numeric
value into the int and read back the char.

I don't think that will work. The 3U value of 56 has the value x'38', not x'56'.

Here's one way to have the CHR$ procedure convert 56 to x'56':

D ds
D packed 3p 0
D firstByte 1a overlay(packed)

packed = num * 10; // if num = 56, packed = x'560f'
return firstByte; // x'56'

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.