udgetasn

Find the specified assignment and copy it to the assignment value buffer.

short udgetasn(uc, asid, asvalue, mode)

struct uctrl *uc;

unsigned char *asid;

unsigned char *asvalue;

short mode;

Parameters

  • uc—address of the current control block.
  • asid—assignment identifier.
  • asvalue—assignment string value corresponding to asid.
  • mode—assignment value expansion mode, must always be 1.

Return Values

  • 0—No assignment found
  • 1—Assignment found and copied to asvalue buffer

Description

Find the assignment identified by the string asid and copy the assignment to the asvalue buffer.

If the asid is not found, the function returns 0.

This function should always be called with mode = 1. Other modes are reserved for Uniface internal usage.

Note:   It is the responsibility of the DBMS connector developer to provide a buffer large enough to hold the assignment string.

Consider the following assignment:

my_assignment = Pass this string back as a whole

The assignment value corresponding to my_assignment can be retrieved as follows:

ProcessAssignments ( struct uctrl * ControlBlock )
{
short FoundAssignment;
unsigned char AssignmentString[MAXLEN_ASSIGNMENT_STRING];
FoundAssignment=udgetasn (ControlBlock, "my_assignment",
AssignmentString, 1 );
if (FoundAssignment)
{
/* The AssignmentString buffer now contains */
/* “Pass this string back as a whole” */
}
else
{ /* my_assignment was not found; contents of */
/* AssignmentString undefined */
}
}