Description
This component allows AS/400 commands that returns a value, such as Rtvsysval.
From your application, you can send a command to your AS/400, and receive values from the command.
How to use
Step 1 : Fill the Command property. It can contains some variable declarations.
Step 2 : Run the execute function.
Step 3 : Examine the resulting variables with FieldByName method.
Example: Retrieve a Data Area value
JobRcvMsg.command:=’dta=char(200);rtvdtaara dtaara(*lda) rtnvar(&dta)’
JobRcvMsg.execute;
MsgToSendToJob.Text:= trim(JobRcvMsg.Fieldbyname('dta').AsString);
Properties
Command
property Command:TStrings;
Description
This property holds the text of the command. It can also contain declaration of variable types and sizes.
Here is the general syntax :
<decl1>;<Decl2>...;<Decln>;MYCOMMAND &PARM1 (&Decl1), ....
Each item are separated by a semicolon. Declarations can have the form :
NAME=CHAR(xx)
or NAME=DEC(xx yy)
Default type of a variable is CHAR. You must specify a size of a character variable if it exceeds 20 characters.
Fields
property Fields[index:integer]:TACE400Field;
Description
This function is used to retrieve result value(s).
CommandText
property CommandText:string;
Description
This property has the same purpose as the Command Property. It is an easiest way to setup the command at run time.
For syntax of the command, see description of Command Property.
Methods
Execute
procedure Execute;
Description
This function executes the command.
If the execution fails, it generates an exception.
FieldByName
function FieldByName(const FieldName:string):TACE400Field;
Description
This function is used to retrieve result value(s).
This allow an easy access to values, like this:
Result := MyACE400Rtv.FieldByName('MYVAR').AsString;