arexx.class AM_EXECUTE doesn't work with PROGDIR:

This forum is for general developer support questions.
Post Reply
chris
Posts: 564
Joined: Sat Jun 18, 2011 12:05 pm
Contact:

arexx.class AM_EXECUTE doesn't work with PROGDIR:

Post by chris »

This works:

Code: Select all

	IDoMethod(arexx_obj, AM_EXECUTE, "Rexx/MyScript.rexx", NULL, NULL, NULL, NULL, NULL);
This doesn't:

Code: Select all

	IDoMethod(arexx_obj, AM_EXECUTE, "PROGDIR:Rexx/MyScript.rexx", NULL, NULL, NULL, NULL, NULL);
I can only assume arexx.class has its own ideas what PROGDIR: points to, but none of the other libraries/classes behave like this AFAIK.
xenic
Posts: 1185
Joined: Sun Jun 19, 2011 1:06 am

Re: arexx.class AM_EXECUTE doesn't work with PROGDIR:

Post by xenic »

@chris
If you look at the underlying LaunchArexxScript() function in rexxsyslib autodocs it looks like a request (message?) is passed to Rexx resident process to launch your ARexx script. If that's the case, then PROGDIR: might resolve to the directory that "RexxMast" was started from (SYS:System).

Try running Snoopy while your program attempts to run the script with PROGDIR: as the location. You should be able to tell where RexxMast is looking for your script with a lock() or open() command.
AmigaOne X1000 with 2GB memory - OS4.1 FE
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 534
Joined: Sat Jun 18, 2011 4:12 pm
Location: Finland
Contact:

Re: arexx.class AM_EXECUTE doesn't work with PROGDIR:

Post by salass00 »

As xenic says the command is sent asynchronously so you should get an absolute path and use it like so:

Code: Select all

TEXT scriptname[1024];
IDOS->NameFromLock(IDOS->GetProgramDir(), scriptname, sizeof(scriptname));
IDOS->AddPart(scriptname, "Rexx/MyScript.rexx", sizeof(scriptname));
IIntuition->IDoMethod(arexx_obj, AM_EXECUTE, scriptname, NULL, NULL, NULL, NULL, NULL);
chris
Posts: 564
Joined: Sat Jun 18, 2011 12:05 pm
Contact:

Re: arexx.class AM_EXECUTE doesn't work with PROGDIR:

Post by chris »

I worked around it using DevNameFromLock()
So it's not a real bug but a side-effect of it running in RexxMast's context. That's fine then, now I know.
Thanks
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 600
Joined: Sat Jun 18, 2011 3:40 am
Location: Portsmouth, UK
Contact:

Re: arexx.class AM_EXECUTE doesn't work with PROGDIR:

Post by broadblues »

This excatly the issue I came across with SketchBlock and launching arexx commands and why I setup a Sketchpath: assign.
Post Reply