On Thu, 8 Jun 2006, Andy Gibb wrote:
>> this NDF copying...). Although it works, the code has a check for the total
>> number of HDS locators at the start and finish of execution, and they're
>> off by 1. I've tracked it down, and it seems that when the VARIANCE
>> component is created in #2 by the ndfMap, the # of HDS locators increases
>> by 1, but then it doesn't go down by the correct amount with the ndfAnnul.
>
> The HDS locator problem was tracked down to the following call to
> ndfMap:
>
> ndfMap( indf, "QUALITY", dtype, mode, &outdata[2], &nout, status );
>
> which looks OK, except that dtype is set to "_DOUBLE" rather than
> "_UBYTE". (Brought to you today by cut & paste :)
>
> Now I would have thought that checking status would have told us that
> something was wrong here but status is still good on return, so we had
> no way of knowing a) that there was a problem and b) what the problem
> was until we got the HDS locator error.
Hi Andy,
the data type given to ndfMap doesn't need to match that of the underlying
data, it's a requested type, not the data type. NDF takes care of
converting to the type you asked for, and converting it back when the data
is released (write or update access). So this is a valid operation. Now if
you'd tried to do an "ndfStype" on a quality component, then that would
throw an error as the underlying data type cannot be modified.
Cheers,
Peter.
|