09 March 2024, 17:36 | #1 |
Registered User
Join Date: Nov 2019
Location: Celle / Germany
Posts: 147
|
Problem passing Arexx parameters
Hi guys,
I am struggeling with passing parameters to my program. I want to send a filename with full path to my program this way: rx MYPROGRAM OPEN "Ram Disk:file" where MYPROGRAM is the Arexx-Port of my listening program, OPEN is a command and "Ram Disk:file" is the filename my program should process. I am checking the incoming Arexx-Message and parse rm_Args[0]. My problem is, the parameter seems to be parsed by the RexxHost or so as I always get this arexxstring: OPEN Ram Disk:file without the quotes. How can I get the parameter string unchanged so that I can parse the parameters correctly? |
09 March 2024, 19:40 | #2 |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,326
|
I think you cannot use MYPROGRAM as an Arexx-Port.
What about "PARSE ARG cmd filename ." in your script to parse arguments? |
10 March 2024, 07:04 | #3 |
Registered User
Join Date: Nov 2019
Location: Celle / Germany
Posts: 147
|
Sorry that was an unclear explanation:
MYPROGRAM is just a placeholder, not the real portname, the real portname is "PED.1". And my program itself is not arexx, but AmiBlitz. To be concrete, I want to implement an arexxcommand "OPEN" that lead my program to open the file passed to it with the command. That works well until a path or filename has a space in its name. And as I want to add additional parameters, I can not concatenate the parameter strings in my program. Last edited by Honitos; 10 March 2024 at 07:09. |
10 March 2024, 09:45 | #4 | |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 7,051
|
You can use any name as an ARexx port, why should "MYPROGRAM" be different?
Quote:
If you want to keep quotes in strings you have to surround them by quotes, too. The only difference to a command in a script is that rx does not accept single quotes for the outer surrounding. This makes the command line a bit ugly because to keep double quotes in a string surrounded by double quotes you have to double them... This one should work: rx MYPROGRAM OPEN """Ram Disk:file""" this one looks a bit more readable (well, it would if there was another argument behind the file name): rx MYPROGRAM "OPEN ""Ram Disk:file""" In a script you would use single quotes: Code:
/* rexx */ address MYPROGRAM 'OPEN "Ram Disk:file"' |
|
10 March 2024, 17:02 | #5 |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,326
|
Sorry, I thought already that I don't have understood the question/problem.
That MYPROGRAM is a placeholder is clear but I didn't knew that you can use "rx <portname> [<arguments>]". |
11 March 2024, 09:35 | #6 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 7,051
|
You are certainly right, this is not possible.
Rx either calls a script or executes a command if it begins with a quote. If you enter Code:
rx myprogram open "Ram Disk:file" Code:
/* rexx */ say arg(1) Code:
open "Ram Disk:file" But the question was about an ARexx port. If you send data to an ARexx port from an ARexx script, then ARexx first processes the command line before it sends it to the port To do this from rx, you would have to enter Code:
rx "address myprogram open """"""Ram Disk:file""""""" Code:
rx "address myprogram open '""Ram Disk:file""'" |
15 March 2024, 15:16 | #7 |
Registered User
Join Date: Nov 2019
Location: Celle / Germany
Posts: 147
|
Thanks for clarification!
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem Calling ARexx Command | tygre | Coders. C/C++ | 10 | 15 March 2023 23:41 |
Problem executing DOpus5 Arexx Script ... | beltrixx | support.Apps | 1 | 01 August 2015 22:16 |
Passing parameters to a script via WBRun | mfilos | support.Other | 18 | 14 January 2014 22:29 |
Passing arguments to scripts | Leffmann | Coders. General | 4 | 23 January 2009 20:43 |
Norwegians passing thru OSLO? PLEASE READ :) | AmiDelf | Amiga scene | 0 | 29 September 2003 15:11 |
|
|