Page 1 of 1
ARexx port: How to return a list of values
Posted: Mon Jan 15, 2024 6:48 pm
by mrupp
Hi there
I'm implementing an Arexx port for my RapaGUI based "SonosController" and am trying to follow these guidelines here:
https://wiki.amigaos.net/wiki/UI_Style_ ... rning_Data
It says when returning a list of values they should be returned as an array.
In the HW docs I only found an example returning a single value (which works fine). I tried to return an array like this:
but this didn't work out on the ARexx script's side.
Is this possible or not?
Thanks for your help,
Michael
Re: ARexx port: How to return a list of values
Posted: Sat Jan 20, 2024 11:20 pm
by airsoftsoftwair
What is the context here? Are you trying to return values to ARexx when getting the "OnArexx" message or what are you trying to do?
Re: ARexx port: How to return a list of values
Posted: Sun Jan 21, 2024 1:03 pm
by mrupp
Yes, exacly.
I'm trying to return not only one but a list of values back to the ARexx script that has called a function which I handle in the "OnArexx" event.
Here's an excerpt from
https://wiki.amigaos.net/wiki/UI_Style_ ... rning_Data (chapter "Returning Data")
When the command returns multiple records, it should allow the user to specify a stem variable to place the contents in. For example, a command that would return the names of the loaded documents in a text editor would normally return information in the RESULT field, but if the user chooses to place the information in a stem variable, he could specify:
which would return:
Code: Select all
DocList.count = 3
DocList.0 = Letter to John Doe
DocList.1 = Notes on Standards
DocList.2 = Addresses of the Stars
In the above example, DocList.count contains the number of records in the array. Also note that the elements do not contain quotes around the information.
In my case (app
SonosController), I would like to return a list (array?) of track names to the ARexx script with a command to query the current playlist.
Re: ARexx port: How to return a list of values
Posted: Sun Jan 28, 2024 12:26 pm
by airsoftsoftwair
mrupp wrote: ↑Sun Jan 21, 2024 1:03 pm
Yes, exacly.
I'm trying to return not only one but a list of values back to the ARexx script that has called a function which I handle in the "OnArexx" event.
I don't think that this is technically possible. The interface in rexxsyslib.library expects all return values to be strings so Hollywood can't really pass anything else back to ARexx. So if you want to return a list or something, I think you'd manually have to "stringify" that list somehow, maybe by embedding the individual list entries in quotes or something in one large string.
Re: ARexx port: How to return a list of values
Posted: Tue Jan 30, 2024 7:43 pm
by mrupp
OK, thanks for clarifying this.