Hi Everyone,
I am trying to return an array of values from a function which is called when a
successful SQL call is made.
The problem I am having is that msgArray.length always equal to 0 even though
when I am inside the function it has a value.
Can I not return a value from the transaction success handler function? I am
going to this trouble because I really hate global variables.
function GetQEntryMsgsfromDB(aQEntryRecord){
var mw_db = init_core_DB();
var msgArray = new Array();
mw_db.transaction(function(transaction){
transaction.executeSql('SELECT * FROM QueueMsg Where APP_ID=? AND
REFOBJTYPE=? AND REFOBJKEY=? AND TARGETXML=?;',
[aQEntryRecord.appid, aQEntryRecord.refobjtype, aQEntryRecord.refobjkey,
aQEntryRecord.targetXML],
function(transaction, results){ msgArray = ProcessMsgDBResults(results);
} , errorHandler);
});
alert('returning array' + msgArray.length);
}
Your thoughts are appreciated.
Alon Raskin
e: [email protected]<mailto:[email protected]>
--
You received this message because you are subscribed to the Google Groups
"iPhoneWebDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/iphonewebdev?hl=en.