Forum Discussion
KenCasser
7 years agoQrew Cadet
Dan - I have succeeded with 'GetDBVar', but my limited knowledge is preventing me from translating that to 'SetDBVar'. Here's what I've got. Where am I going wrong?
function setDBVar(dbid, varDaName, 12) {
return Promise.resolve(
$.set(dbid, {
act: "API_SetDBVar",
varname: varDaName
})
).then(function(xml) {
return $("value", xml).text();
});
}
getDBVar(dbid, varDaName)
.then(function(varValue) {
console.log('${varDaName} = ${varValue}');
});
Thank you!
Ken
function setDBVar(dbid, varDaName, 12) {
return Promise.resolve(
$.set(dbid, {
act: "API_SetDBVar",
varname: varDaName
})
).then(function(xml) {
return $("value", xml).text();
});
}
getDBVar(dbid, varDaName)
.then(function(varValue) {
console.log('${varDaName} = ${varValue}');
});
Thank you!
Ken
- _anomDiebolt_7 years agoQrew Elite
function setDBVar(dbid, dbvName, dbvValue) {
return Promise.resolve(
$.get(dbid, {
act: "API_SetDBVar",
varname: dbvName,
value: dbvValue
})
).then(function(xml) {
return $("value", xml).text();
});
}
var dbid = "";
var dbvName = "";
var dbvValue = "";
setDBVar(dbid, dbvName, dbvValue)
.then(function(dbvValue) {
console.log('${dbvName} = ${dbvValue}');
}); - KenCasser7 years agoQrew CadetThank you! I got it to work, and tried getting the 'Set' and a 'Get' to work in sequence and then nothing worked! I'll have to play with it more tomorrow, but thank you for your help.
- KenCasser7 years agoQrew CadetIt's all working now! Thank you so much for your help.
- _anomDiebolt_7 years agoQrew EliteGo Script!