Is there any way to quit a commodity? I've looked through the library and the only thing that looks to do the job is the hidden BrokerCommand() function.
I can't even see a way to find out if a commodity exists without trying to create one.
Even the CxExchange program cannot be told to do it nor does it have an Arexx port.
I thought that Commodities Exchange had a button to shut down commodities. "Remove," or something similar.
If not, commodities are supposed to have a GUI, which can be shown using Cx Exchange. Then you can use the GUI to shut it down.
Yes the Exchange can do it. Not all commodities have a GUI. I should know as I've written some. :-)
However, I'm looking for a way to do it it programmatically. I thought commodities.library could do it but don't see how. Would be out of the question loading up CxExchange and simulating GUI events with custom messages. :-D
It would involve locating the commodity process then simulating a CX_QUIT message. So a bit like hacking a WB starter. Sending a phantom message to do the job.
The BrokerCommand() function used to be private and reserved to Exchange, but was made public in OS4 several years ago.
Thanks. So it is possible. I didn't look too deep into it but the documentation must be behind as it's stil llisted as private. My SDK is fairly recent. But not the lastest I think.
Oh yes, otherwise I wouldn't have been able to write my Exchanger tool (to replace the old Exchange).
AFAIR Steven Solie made BrokerCommand() - as well as other previously reserved functions - public around the year 2013, and they became available in commodities.library version 53.4. I'm pretty sure this was before OS4.1 Final Edition.
there is CLIExchange on os4depot and it's source code inc ase it helps too.
To do that you use CopyBrokerList(), another formerly-private function. Just browse the list of Brokers it returns until you find the one you want (or don't, if it doesn't exist).
My OS4.1 Update 6 partition -- which includes all the online updates -- has commodities.library v. 53.7. The Release Notes for commodities.library says that v. 53.7 (2013-08-29) "Added new broker query API." It may be that 53.4 was never released publicly, so 53.7, which was one of the OS 4.1.6 online updates, was the first public appearance of the new functions.
The new functions should certainly be available if you're targeting FE. If you want to work with earlier OS versions you'll need to check the commodities.library version.