[Contents] [Previous] [Next] [Index]

callC

Calls an external function and returns the value that the external function returns.

Server-side function

Implemented in

LiveWire 1.0

Syntax

callC(JSFunctionName, arg1,..., argN)

Parameters

JSFunctionName
The name of the function as it is identified with RegisterCFunction.

arg1...argN
A comma-separated list of arguments to the external function. The arguments can be any JavaScript values: strings, numbers, or Boolean values. The number of arguments must match the number of arguments required by the external function.

Description

The callC function is a top-level server-side JavaScript function that is not associated with any object.

The callC function returns the string value that the external function returns; callC can only return string values.

Examples

The following example assigns a value to the variable isRegistered according to whether the attempt to register the external function echoCCallArguments succeeds or fails. If isRegistered is true, the callC function executes.

var isRegistered =
   registerCFunction("echoCCallArguments",
      "c:/mypath/mystuff.dll",
      "mystuff_EchoCCallArguments")
if (isRegistered == true) {
   var returnValue =
   callC("echoCCallArguments", "first arg", 42, true, "last arg")
   write(returnValue)
}

See also

registerCFunction


[Contents] [Previous] [Next] [Index]

Last Updated: 10/31/97 16:38:00


Copyright © 1997 Netscape Communications Corporation