Writing a separate mapping for each combination means writing a new
VCF function per mapping. This is because depending on the case the
VCF has to perform the equivalent functionality of either 1,2 or 3
VCFs.
I could wrap calls to the existing VCFs in a holder function that
passes on the relevent data/parameters to the existing VCFs and map
this function to the command, but this solution doesn't scale very
well to larger no.s / combinations.
My solution is as follows:
// added to - functions.js
var gCmdStack = [];
// Get next cmd of the stack and execute - should be called as the
last function in EVERY command
function ProcessCmdStack() {
if(gCmdStack.length > 0) {
var cmdObj = gCmdStack.shift();
handleRequest(cmdObj[0], cmdObj[1]);
}
return true;
}
function QueueCmd(aCmd, aParams) {
if(!aParams)
aParams = [];
gCmdStack.push([aCmd, aParams]);
}
For every command that needs to be sequentially executed i add the
following line as a VCF to the command map
// mapping.js
mapCommandToVCF('cmd', ProcessCmdStack);
Then to stack commands i just call
QueueCmd('cmd', parameters);
in the same way i would call handleRequest('cmd');
On Nov 26, 10:51 am, Lee Barney <
barney....@gmail.com> wrote:
> If the combinations are known and fixed you could make a mapping for each
> one. Is each possibility the result of a different event?
>
> Lee
>
> > <
quickconnectiPhone%2Bunsu...@googlegroups.com<
quickconnectiPhone%252Buns...@googlegroups.com>