JavaSetChar Function

Action

Sets a char parameter for the next function or constructor call.

Note: Parameters must exactly match the method signature and be in order.

Include file

Java.bdh

Syntax

JavaSetChar( in hObject : number,
             in nParam  : number );
Parameter Description
hObject Valid handle to a java object or JAVA_STATIC_METHOD.
nParam The ordinal number of the char value to be set as parameter.

Example

var
  hTestObj : number; 

dcltrans
  transaction TInit
  begin
    // Load and start the JVM.
    JavaCreateJavaVM();
    // instantiate the java class: java.lang.Character 
    JavaSetChar(JAVA_STATIC_METHOD, ord('c'));
    hTestObj := JavaLoadObject("java/lang/Character");
  end TInit;

  transaction TMyJavaTrans
  var
    charNum : number;
  begin                               
    // calling charValue() method of java.lang.Character object
    JavaCallMethod(hTestObj, "charValue");
    charNum := JavaGetChar(hTestObj);
  end TMyJavaTrans;

  transaction TEnd
  begin
    JavaFreeObject(hTestObj);
  end TEnd;