Hello
I'm developing a Parse.com plugin for C2, and I get this annoying error.
When I set the value to a variable in C2 using an expressesion, it gets turned into 0.1 for any integer or float.
When I log to the console directly from runtime, it returns the correct result. When I do it using C2, it returns 0.1 in the console log.
This is my code in runtime:
Exps.prototype.QueryHighest = function (ret,par0,par1,par2)
{
var Object = Parse.Object.extend(par0);
var query = new Parse.Query(Object);
// Retrieve the values descending
query.descending(par1);
query.first({
success: function(result) {
var Return = result.get(par2);
console.log(Return);
if(isNaN(Return)){
ret.set_string(Return);
console.log("set_string");
}else if(!isNaN(Return)){
if(isInt(Return)){
ret.set_int(Return);
console.log("set_int");
}else{
ret.set_float(Return);
console.log("set_float");
};
}else{
ret.set_any(Return);
console.log("set_any");
};
},
error: function(error) {
alert("Error: " + error.code + " " + error.message);
}
});
};[/code:re1csazq]
And for the edittime:
[code:re1csazq]AddStringParam("class","Which class does the object lie in?");
AddStringParam("search attribute","The attribute whose value you want to search for.");
AddStringParam("attribute","The attribute whose value you want to get.");
AddExpression(0, ef_return_any, "Parse query: highest result", "Search Query", "QueryHighest", "Returns the highest value from a specified attribute.");
[/code:re1csazq]
And in C2:
[img="http://i.imgur.com/sbBdWbQ.png?1?5042"]