pc.call

Processing Code/Restore Processor, Releases: AP

Calls Pick/BASIC subroutine from dictionary.

Syntax

call {cataloged.subroutine}

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.

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.

See Also

Command Name Type Description
output-conversion Attribute Defining Item References attribute 14 of a dictionary.
up.output-conversion.adi Processing Code Processing codes available from UP at output time.
attribute.defining.items Introductory An overview of attribute-defining items.
basic.access Function Interface between Access and Pick/BASIC.
processing.codes Definition Overview of processing codes.
file.defining.items Definition File-defining item overview.
up.input-conversion.adi Processing Code Processing codes available from UP after input.
basic.inputerr Statement Used with 'input' to display error message on status line.
up.correlative.adi Processing Code Processing codes available from UP at pre-processsing time.
input-conversion Attribute Defining Item References attribute 14 of a dictionary.
ue.31bc User Exit Subroutine call.
ue.41bc User Exit Subroutine return.
up.correlative Definition refers to processing codes that can be defined on the 'correlative' dictionary of the file-defining item which affect the item when it is filed.
up.input-conversion.fdi Processing Code Processing codes available from UP before update begins.
ue.51bc User Exit Subroutine return.
pc.callx Processing Code Calls Pick/BASIC subroutine any time an item is filed.
pc Introductory

User Comments

What do you think?

Share your experience or ask a question by using the form below.

Login to leave your comments.