Commit f80bc8cd authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

vlistInqVarCode: set code to -varID-1 if pdis=255

parent 37d6c8fe
......@@ -466,7 +466,7 @@ The function @func{vlistInqVarCode} returns the code number of a variable.
int vlistInqVarCode(int vlistID, int varID)
{
vlist_t *vlistptr;
int param, code;
int param, code = -varID-1;
int pdis, pcat, pnum;
vlistptr = vlist_to_pointer(vlistID);
......@@ -475,7 +475,9 @@ int vlistInqVarCode(int vlistID, int varID)
param = vlistptr->vars[varID].param;
cdiDecodeParam(param, &pnum, &pcat, &pdis);
code = pnum;
if ( pdis == 255 ) code = pnum;
printf("pdis %d pnum %d code %d\n", pdis, pnum, code);
if ( code < 0 && vlistptr->vars[varID].tableID != -1 && vlistptr->vars[varID].name != NULL )
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment