Enhancement for CreateRexxPort()

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

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")
EndFunction

m_arexxPortName$ = "MY_COOL_PORT"
Local count = 1
Local name$ = m_arexxPortName$ .. "." .. count
While p_ARexxPortExists(name$)
	count = count + 1
	name$ = m_arexxPortName$ .. "." .. count
Wend
CreateRexxPort(name$)
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.

Cheers,
Michael
User avatar
airsoftsoftwair
Posts: 5450
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Enhancement for CreateRexxPort()

Post by airsoftsoftwair »

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