STK - Access any stock details (Stock Control Report Generator function)

From Catalyst
Jump to: navigation, search

Syntax

$STK{stock, expression}

Description

In general, changes the Stock code being reported on.


Parameters

stock
A text parameter that can be omitted.
Stock code to use (see below).
expression
A text or numeric parameter that can be omitted.
Variable or formula to evaluate (see below).

Returns

A text or numeric (depending on the parameters) value. This function may be used in three ways.

All parameters are supplied.
$STS{S44,S02}
The result of the given expression using the details of the stock code supplied is returned. For the example above, (using the variable S44), the description of the stock code which supersedes the current one (if there is one) would be returned.
No expression is supplied.
$STS{S44}
Changes the stock code being reported on; i.e. all 'S' Variables (and other variables which use the current stock code being reported on), in the remainder of the current block will use the details from the stock supplied. If used In a Range screen then this will affect the whole report. If no expression is supplied, the actual result of the function will be numeric - '1' if the stock code exists or '0' if otherwise.
No parameters are supplied.
$STS{}
The Function may be used in this way in a block after using the function as in method 2, to change the stock code being reported on back to the previous value.