Pathmaker Programming Guide

Modifying Requesters
Advanced Pathmaker Programming Topics
067868 Tandem Computers Incorporated 9–23
Most programmers use a CASE statement in their user conversion procedure to select
the code they want performed. The following is a pseudocode fragment that shows
the overall structure of a TAL user conversion procedure for converting alphanumeric
input:
PROC USER^ALPHA^INPUT^CONVERSION (USERCODE, ERROR,
INPUT, INPUT^LEN, INTERNAL, INTERNAL^LEN);
INT USERCODE;
INT .ERROR;
STRING .INPUT;
INT INPUT^LEN;
FIXED .INTERNAL;
INT INTERNAL^LEN;
BEGIN ! procedure
CASE usercode OF
BEGIN ! case
!0!
strip fill characters from left portion of
string
!1!
strip fill characters from right portion of
string
!2!
strip fill characters from both right and
left portions of string
END; ! case
END; ! procedure
See the Pathway Application Programming Guide for more information about coding and
binding user conversion procedures and for the procedure declarations of the nine
user conversion procedures.
You indicate to the Pathmaker product that you want to include one or more user
conversion procedures by specifying a number in the User Conversion field of the
Display Detail screen. The User Conversion field number becomes the USERCODE for
this data item. If you specify a number in the User Conversion field of the Display
Detail screen, you must provide a corresponding user conversion procedure. The
Pathmaker product adds a USER CONVERSION clause to the Screen Section of the
requester to associate the number you specified with a particular data item.
For example, assume you wrote a user conversion procedure to strip fill characters
from the right and left portion of a character string and that you assigned this user
conversion procedure a user code of 2 in your TAL program. In the Pathmaker full
screen interface, you must enter a 2 into the User Conversion field of the Display
Detail screen of every alphanumeric data item that you want to convert in this way.
You are responsible for writing the TAL user conversion procedure and for adding it
to the TCP user-library object file.