OConv problems & ascii---]binary conversion (OpenInsight Specific)
At 22 MAR 2001 08:13:05PM Peter Richards wrote:
Hi,
Having some problems with using OConv, at first thought it was because the value to be converted was a record mark, but have found the following:
TestFF=OConv(IConv("FF","HEX"),"HEX") ;* won't return value 'FF'
TestFE=OConv(IConv("FE","HEX"),"HEX") ;* ditto
TestFD=OConv(IConv("FD","HEX"),"HEX") ;* ditto
etc,etcTestF8=OConv(IConv("F8","HEX"),"HEX") ;* returns val 'F8'
I'm working with MPEG frame headers in OI 3.7.2, and the first byte of the frame hdr is always hex 'FF' (or should be). The ascii equiv of course is a record marker. How to get around the OConv bug without hard code (yuk !! ) ??
Also, is there an easier way to convert from ASCII –] BINARY, rather than
Param1=ÿ
?d"
MpegFrameHdr=OConv(IConv(OConv(Param1,"HEX"),"MX"),"MB")
The above doesn't work of course , if any of the ascii values are \FF\ through to \F9\
Regards,
Peter
At 22 MAR 2001 08:29PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
Peter,
You could resort to something like this:-
<code>
FUNCTION HEXCONV(PARAM)
OUTPUT=' FOR I=1 TO LEN(PARAM)
CHAR=PARAMI,1 IF SEQ(CHAR) The Sprezzatura Group[/url]World Leaders in all things RevSoft
At 22 MAR 2001 11:01PM Peter Richards wrote:
Hi,
Thank you, I have just tested the Function HEXCONV you supplied, it does the job perfectly.
Peter