Query: Can the API perform instructions out of order? Background: I'm banging my head against the wall here and after a lot of logging, it appears that the API can perform instructions out of order. I'm doing a .get on the notes field of a handout and it appears that the script will continue running while the .get function is occurring. Is this a known thing? Is there a way to prevent it? Code and results below: var HistoricalData = findObjs({_type: 'handout', name: 'Weather By Historical Date'})[0];
log (HistoricalData);
log (HistoricalData.id);
var FinalNotes = "Declaration value";
log ("In: " + FinalNotes);
var character = getObj("handout", HistoricalData.id);
character.get("notes", function(n) {
log("Getting notes...");
log("Notes: " + n);
FinalNotes = n;
});
log ("Out: " + FinalNotes);
}
Log:
{"name":"Weather By Historical Date" <snipped unimportant data>
"-K9Jlp_MXau3Tg3WQW4F"
"In: Declaration value"
"Out: Declaration value"
"Getting notes..."
"Notes: Test Description and Notes"