ejArgs | GoAhead JavaScript API | GoAhead EMF |
Crack the arguments given to an JavaScript script procedure.
#include "ej.h" int ejArgs(int argc, char_t **argv, char_t *fmt, ...);
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 |
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.
Returns the number of arguments found in args .
if (ejArgs(argc, argv, "%s %d", &name, &age) < 2) { websError(wp, 400, "Insufficient args\n"); return -1; }