JavaGetChar Function

Action

Retrieves the ordinal number of the char return value of the last call of JavaCallMethod on the specified object or class.

Include file

Java.bdh

Syntax

JavaGetChar( in hObject: number ): number;

Return value

  • Returns the result of the last call of JavaCallMethod.

Paremeter Description
hObject Valid handle to a java object or JAVA_STATIC_METHOD.

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;