RX return code issue

A forum for general AmigaOS 4.x support questions that are not platform-specific
Post Reply
User avatar
polluks
Posts: 61
Joined: Tue May 19, 2015 7:30 pm
Location: Germany
Contact:

RX return code issue

Post by polluks »

Code: Select all

> RX "exit 42"
> get rc
42
good

Code: Select all

/* 42.rexx */
exit 42

Code: Select all

> RX 42.rexx
> get rc
0
bad
FlynnTheAvatar
Posts: 7
Joined: Thu Aug 11, 2022 1:41 pm

Re: RX return code issue

Post by FlynnTheAvatar »

For reference: this works correctly under classic AmigaOS.
I tested it on 1.3, 2.1, 3.1 (ARexx 1.15) and 3.2.3, and all of them return the correct RC when running RX 42.rexx with a simple exit 42.
So the incorrect return code seems to be specific to the OS4 RX interpreter.
User avatar
nbache
Beta Tester
Beta Tester
Posts: 1771
Joined: Mon Dec 20, 2010 7:25 pm
Location: Copenhagen, Denmark
Contact:

Re: RX return code issue

Post by nbache »

@FlynnTheAvatar

Thanks for refreshing this one.

@polluks

When you posted this back in June, I tried to reproduce it, but at first it seemed to work for me. Then I got sidetracked and forgot to do more investigation, sorry.

Now I tried some more, and I think I found a way to reproduce it.

Could you try repeating your test, but in the third step, instead of typing "RX 42.rexx", just type "RX 42".

Does that work correctly?

That's what I found here at least.

If you can confirm, I'll try making a bug report about it. Not sure which component exactly is at fault, though, nor when/if it can be fixed at all in the old ARexx code, but at least we will know the workaround: Omit the .rexx suffix when invoking an ARexx script file (it is optional after all). Yes, I know, crude, but still ...

Oh, and @FlynnTheAvatar: I would be curious to know whether the same difference is present in the classic version. Your comment above seems to indicate it's not, but could you please verify again?

Best regards,

Niels
Post Reply