JoltGetOccurrenceCount Function

Action

Retrieves the number of occurrences of a specified JoltRemoteService object attribute item.

Include file

Jolt.bdh

Syntax

JoltGetOccurrenceCount( in hRemoteService : number,
                        in sAttribute     : string ): number;

Return value

Number of occurrences of the specified JoltRemoteService object attribute item.

Parameter Description
hRemoteService Handle to a JoltRemoteService object that was created with JoltRemoteServiceNew
sAttribute Name of the attribute item

Example

var
  hSession, hSessionAttr, hRemoteService: number;
dcltrans
  transaction TInit
  begin
    JavaSetOption(JAVA_VERSION, JAVA_V11);
    JavaSetOption(JAVA_HOME, "c:/jdk1.1.7");
    JavaSetOption(JAVA_CLASSPATH, "c:/jdk1.1.7");
    JoltInit();
    hSessionAttr := JoltSessionAttributesNew();
    JoltSetString(hSessionAttr, APPADDRESS, "//lab:8000");
    hSession := JoltSessionNew(hSessionAttr, "", "ATM", "", "");
    hRemoteService := JoltRemoteServiceNew("SUM", hSession);
  end TInit;
    transaction TMain
  var
    nSum: number;
  begin
    JoltSetInt(hRemoteService, "IVALUE", 23, ADD_VALUE);
    JoltSetInt(hRemoteService, "IVALUE", 11, ADD_VALUE);
    JoltSetInt(hRemoteService, "IVALUE", 38, ADD_VALUE);
    write(JoltGetOccurrenceCount(hRemoteService, "IVALUE"));
    JoltCall(hRemoteService);
    nSum := JoltGetInt(hRemoteService, "RESULT", 0);
    writeln(nSum);
  end TMain; 

  transaction TShutdown
  begin
    JoltEndSession(hSession);
    JoltFreeObject(hRemoteService);
    JoltFreeObject(hSession);
    JoltFreeObject(hSessionAttr);
  end TShutdown;

See also

Java: bea.jolt.JoltRemoteService class