Quantcast
Channel: WinDev Forum
Viewing all articles
Browse latest Browse all 1914

[WD22] How to Get Data Source from Thread (no replies)

$
0
0
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().

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


Viewing all articles
Browse latest Browse all 1914

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>