1. How can I tell if a Data Source var has been initialized?
2. How can I access a threaded Data Source var in the main thread? I tried using a global data source, but that did not work. I also tried using the various constants for the second param in ThreadExecute(). Thread params are passed by value, not address, so I understand why dsRes isn't ever initialized in LoadTable().
2. How can I access a threaded Data Source var in the main thread? I tried using a global data source, but that did not work. I also tried using the various constants for the second param in ThreadExecute(). Thread params are passed by value, not address, so I understand why dsRes isn't ever initialized in LoadTable().
PROCEDURE LoadTable()
IF ThreadState("ItemList") <> threadRunning THEN
ThreadExecute("ItemList", threadNormal, ItemList, dsRes)
ThreadWait("ItemList", 1000)
END
FOR EACH dsRes // Error here, dsRes is not initialized
// Fill Table (TableAddLine())
END
PROCEDURE ItemList(dsRes is Data Source)
sQry is string = "SELECT * FROM Universe"
IF NOT HExecuteSQLQuery(dsRes,hQueryDefault,sQry) THEN
Error("Oops")
END