pc.call Processing Code/Restore Processor

pc.call

Command pc.call Processing Code/Restore Processor
Applicable release versions: AP
Category Restore Processor (84)
Description calls a Pick/BASIC subroutine from the file-defining item or from an attribute-defining item.

The syntax for calling a subroutine does not specify any parameters, but the subroutine is passed a parameter anyway, so one parameter must be specified in the "subroutine" statement. However, when a subroutine is called from the file-defining item, the entire item body is passed to the subroutine. When a subroutine is called from an attribute-defining item, the value of the calling attribute is passed to the subroutine.

Subroutines can be called from the "correlative", "input-conversion", or "output-conversion" attributes of file-defining items or attribute-defining items.

When a subroutine is called from the "input-conversion" of the file-defining item, control passes to the subroutine before the operator gets into the file via the Update processor. That is, after the UP command has been executed (:u filename) and before the user gets access to the item.

When a subroutine is called from the "correlative" field of the file-defining item, control passes to the subroutine at file time.

Subroutines called from the "output-conversion" attribute are executed on output for redisplay after entry. Subroutines called from the "correlative" dictionary are executed prior to processing. Subroutines called from the "input-conversion" dictionary are executed after input.

Data may be interrogated and modified in the subroutine using the "access" statement.

Error conditions can be set if an "inputerr" statement is executed in the Pick/BASIC subroutine.
Syntax call {cataloged.subroutine}
Options
Example
Assume that there is an attribute-defining item that contains a call to a 
subroutine called "st.name":

subroutine st.name(st)
states = "alaska,washington,oregon,california,idaho"
codes = "al,wa,or,ca,id"
convert "," to char(254) in codes
locate(st,codes;x) then
st = field(states,",",x)
end else st = "unknown"
return

In this example, the value is passed from Access into the variable, 
"st". If the corresponding string is found, "st" is loaded 
with the appropriate "code" and control returns to Access.
Purpose
Related output-conversion
up.output-conversion.adi
attribute.defining.items
basic.access
processing.codes
file.defining.items
up.input-conversion.adi
basic.inputerr
up.correlative.adi
input-conversion
ue.31bc
ue.41bc
up.correlative
up.input-conversion.fdi
ue.51bc
pc.callx
pc