How to quit a commodity?

8 posts / 0 new
Last post
hypex
hypex's picture
Offline
Last seen: 2 months 1 week ago
Joined: 2011-09-09 16:20
How to quit a commodity?

Hi guys.

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.

:-?

Hans
Hans's picture
Offline
Last seen: 2 months 2 weeks ago
Joined: 2010-12-09 22:04
Re: How to quit a commodity?

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.

Hans

Join the Kea Campus - upgrade your skills; support my work; enjoy the Amiga corner.
https://keasigmadelta.com/ - see more of my work

hypex
hypex's picture
Offline
Last seen: 2 months 1 week ago
Joined: 2011-09-09 16:20
Re: How to quit a commodity?

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.

trixie
trixie's picture
Offline
Last seen: 5 months 2 weeks ago
Joined: 2011-02-03 13:58
Re: How to quit a commodity?

@hypex

I'm looking for a way to do it it programmatically. I thought commodities.library could do it but don't see how.

ICommodities->BrokerCommand("commodityname", CXCMD_KILL);

The BrokerCommand() function used to be private and reserved to Exchange, but was made public in OS4 several years ago.

AmigaOne X5000-020 / 2GB RAM / Sapphire Pulse Radeon RX 560 / AmigaOS 4.1 Final Edition Update 2

hypex
hypex's picture
Offline
Last seen: 2 months 1 week ago
Joined: 2011-09-09 16:20
Re: How to quit a commodity?

@trixie

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.

trixie
trixie's picture
Offline
Last seen: 5 months 2 weeks ago
Joined: 2011-02-03 13:58
Re: How to quit a commodity?

@hypex

Thanks. So it is possible.

Oh yes, otherwise I wouldn't have been able to write my Exchanger tool (to replace the old Exchange).

My SDK is fairly recent.

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.

AmigaOne X5000-020 / 2GB RAM / Sapphire Pulse Radeon RX 560 / AmigaOS 4.1 Final Edition Update 2

jabirulo
jabirulo's picture
Offline
Last seen: 7 hours 2 min ago
Joined: 2013-05-30 00:53
Re: How to quit a commodity?

there is CLIExchange on os4depot and it's source code inc ase it helps too.

http://www.os4depot.net/?function=showfile&file=utility/shell/cliexchange.lha

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

msteed
msteed's picture
Offline
Last seen: 2 months 2 weeks ago
Joined: 2022-01-18 08:34
Re: How to quit a commodity?

I can't even see a way to find out if a commodity exists without trying to create one.

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).

...they became available in commodities.library version 53.4. I'm pretty sure this was before OS4.1 Final Edition.

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.

Log in or register to post comments