Thanks for the input. It looks like Craig's suggestion
would work for me. We have to test whether this will
work with negative numbers.
Once again, thanks!
--- Craig Bennett <[EMAIL PROTECTED]> wrote:
> >I have a Unidata numeric field
> >(Amount- 100.00 or -100.00) and I need to convert
> >to a 8 Bite integer so that Informix will recognise
> Do you mean 8bit or 8byte?
> For an 8 bit integer you need to output CHAR(n)
> where n is a number between
> 0 and 255.
> For an 8 byte (64 bit) integer you would need to do
> something like this. I
> aplogise if this isn't correct UD code, I usually
> work on UV. I am assuming
> that the output integer is in MSB order and that the
> bits of each byte are
> in MSb order.
> ININT = 1145689
> GOSUB MAKE8BYTE
> * Initialise output as 0
> OUTINT = STR(CHAR(0), 8)
> FOR I = 1 TO 8
> * Get lowest 8bits
> LOWESTBYTE = BITAND(ININT, 255)
> * Convert this to a byte representation and
> place it in the output
> OUTINT[8-I, 1] = CHAR(LOWESTBYTE)
> * Remove the lowest byte 8bits from the
> ININT = INT(ININT/256)
> NEXT I
> u2-users mailing list
> [EMAIL PROTECTED]
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
u2-users mailing list