ejArgsGoAhead JavaScript APIGoAhead EMF

Synopsis

Crack the arguments given to an JavaScript script procedure.

Prototype

 #include "ej.h"

 int ejArgs(int argc, char_t **argv, char_t *fmt, ...);

Parameters

argc Number of arguments in argv
argv List of arguments
fmt Sprintf style format string with %s and %d parameters
...Pointers to variables to store %s and %d parameters

Description

The ejArgv procedure is used by JavaScript procedures to crack their ASP scripting arguments. It parses the argvparameter and stores the arguments in individual variables passed to ejArgs. The fmt parameter provides a sprintf style argument specification. Only %s and %d specifiers are supported.

Return Value

Returns the number of arguments found in args .

Example

if (ejArgs(argc, argv, "%s %d", &name, &age) <  2) {
    websError(wp, 400, "Insufficient args\n");
    return -1;
}

See Also

JavaScriptActive Server Pages