Enhancement for CreateRexxPort()

Feature requests for future versions of Hollywood can be voiced here
Post Reply
User avatar
Posts: 141
Joined: Sun Jan 31, 2021 7:44 pm
Location: Switzerland

Enhancement for CreateRexxPort()

Post by mrupp »

Hi there

When creating an ARexx port it is needed to evaluate the next free port number (like "MY_COOL_PORT.1"). This is of course possible to do like this:

Code: Select all

Function p_ARexxPortExists(portName$)
	Local checkPort = RunRexxScript("if show(ports,'" .. portName$ .. "') then return 'yes'", True)
	Return(checkPort = "yes")

m_arexxPortName$ = "MY_COOL_PORT"
Local count = 1
Local name$ = m_arexxPortName$ .. "." .. count
While p_ARexxPortExists(name$)
	count = count + 1
	name$ = m_arexxPortName$ .. "." .. count
m_arexxPortName$ = name$
But as this is the case for all programs that can have multiple instances, it would be nice to be able to just call

Code: Select all

m_arexxPortName$ = CreateRexxPort("MY_COOL_PORT", True)
and CreateRexxPort() with the 2nd param set to True would evaluate the next free portnumber and return the new portname.

What do you think?

And while you're at it, why not integrate a default function ARexxPortExists(portName$) as well, could always come in quite handy, I think.

User avatar
Posts: 5405
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany

Re: Enhancement for CreateRexxPort()

Post by airsoftsoftwair »

Yes, this should be easy to add. I'll see what I can do.
Post Reply