|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectvs.VMSparam
vs.ByDesc
Used to pass a parameter by descriptor. This is equivalent to similar constructs in other languages, such as:
| PL/I |
sts$value = lib$out_output(descriptor('hello world'));
|
| BASIC |
call lib$put_output("hello, world!" by desc)
|
| C |
$DESCRIPTOR(str, "hello, world!");
|
The following Java code performs the same operation:
lib.lib$put_output(new VMSparam[] {
new ByDesc("hello, world!");
});
ByRef,
ByVal| Constructor Summary | |
ByDesc(java.lang.Byte b)
Pass a Byte object by descriptor. |
|
ByDesc(byte[] b)
Pass a byte array by descriptor. |
|
ByDesc(Cmem b)
Pass a Cmem object by descriptor. |
|
ByDesc(int[] b)
Pass an array of int by descriptor. |
|
ByDesc(java.lang.Integer b)
Pass an Integer object by descriptor. |
|
ByDesc(java.lang.Long b)
Pass a Long object by descriptor. |
|
ByDesc(long[] b)
Pass an array of long by descriptor. |
|
ByDesc(java.lang.Short b)
Pass a Short object by descriptor. |
|
ByDesc(short[] b)
Pass an array of short by descriptor. |
|
ByDesc(java.lang.String b)
Pass a String by descriptor. |
|
ByDesc(java.lang.StringBuffer s)
Pass a StringBuffer by descriptor. |
|
ByDesc(VmsStruct s)
Pass a VmsStruct by descriptor. |
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ByDesc(VmsStruct s)
VmsStruct by descriptor.
This is simply a convenience method that is equivalent to the following Java code snippet.
new ByDesc(s.getTarget())
s - VmsStruct to pass by descriptor.public ByDesc(java.lang.StringBuffer s)
StringBuffer by descriptor.
This constructor is different to all other ByDesc constructors
in that it will pass the StringBuffer by dynamic
string descriptor. It can be used to receive a string argument
in the case of this example:
import vs.*;
import vs.starlet.*;
import vs.starlet.STS;
public class GetInput
{
public static final void main(String[] args)
{
StringBuffer buffer = new StringBuffer();
sstatus = lib$get_input.call(new VMSparam[] {
new ByDesc(buffer),
new ByDesc(">>")
});
if (!STS.$VMS_STATUS_SUCCESS(sstatus))
System.out.println("There was an error during input");
else
System.out.println("The following was read: " + buffer.toString());
}
}
Don't forget that this can also be used for arguments that accept
only static string descriptors, like $FAO. It is just necessary to
pre-load the string to ensure enough storage is available. This is
the same as the requirement for BASIC and the purpose of the
SPACE$ builtin function.
s - StringBuffer to be passed by dynamic descriptor.public ByDesc(byte[] b)
byte array by descriptor.
b - byte array to be passed by descriptor.public ByDesc(java.lang.String b)
String by descriptor. This is simply a convenience
method that performs the equivalent of:
ByDesc("hello, world!".getBytes());
Be careful when using this method. It cannot be used to return any
data. The above code snippet creates a new byte array
which is passed to the routine. There is no way or returning a
reference to this storage.
b - String value to be passed by descriptor.public ByDesc(int[] b)
int by descriptor.
b - int array to be passed by descriptor.public ByDesc(short[] b)
short by descriptor.
b - short array to be passed by descriptor.public ByDesc(long[] b)
long by descriptor.
b - long array to be passed by descriptor.public ByDesc(java.lang.Long b)
Long object by descriptor.
b - Long object to be passed by descriptor.public ByDesc(java.lang.Integer b)
Integer object by descriptor.
b - Integer object to be passed by descriptor.public ByDesc(java.lang.Short b)
Short object by descriptor.
b - Short object to be passed by descriptor.public ByDesc(java.lang.Byte b)
Byte object by descriptor.
b - Byte object to be passed by descriptor.public ByDesc(Cmem b)
Cmem object by descriptor.
b - Cmem object to be passed by descriptor.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||