Complex Data Types
When the return value of a method call is an object with a complex data type, the object is stored in the variable; member values can be accessed using a period or full stop to separate the member value from the variable name.
For example, if the result of a call is a data structure similar to the following code structure:
public class FileInfo {
public FileCreds fileCreds;
public int fileSize;
public String fileName;
public String[] fileOwners;
public byte[] fileData;
}
public class FileCreds {
public String userId;
public String password;
public String location;
}
and the return variable name is %result%
, the following table describes the
variables contained in the array:
Variable | Definition |
---|---|
%result% |
Contains the complex object |
%result%.fileName |
Access the fileName field of the object |
%result%.fileData |
Access the fileData field of the object |
%result%.fileCreds.userId |
Access the userId field of the object |
For an array of complex objects, dereference the array before specifying the field name. For
example, for an array of FileInfo structures: %result%[0].fileName
would
access the fileName field of the first item in the array.