How to execute embedded ARexx script?

4 posts / 0 new
Last post
jap
jap's picture
Offline
Last seen: 1 week 1 day ago
Joined: 2011-06-04 05:53
How to execute embedded ARexx script?

Hi,

I'm trying to execute an ARexx script that is part of my C program (the script is in a C character array). I'm using arexx.class.

Executing the script from an external file ("test.rexx") works fine:

  1. IIntuition->IDoMethod (
  2. oArexx,
  3. AM_EXECUTE,
  4. "test.rexx",
  5. NULL,
  6. NULL,
  7. NULL,
  8. NULL,
  9. NULL
  10. );

I can also execute a single ARexx command by quoting it

  1. IIntuition->IDoMethod (
  2. oArexx,
  3. AM_EXECUTE,
  4. "\"say 'Hello there!'\"",
  5. NULL,
  6. NULL,
  7. NULL,
  8. NULL,
  9. NULL
  10. );

but not a long multi-line script with subroutines. Can it be done using the arexx.class?

jabirulo
jabirulo's picture
Offline
Last seen: 22 hours 59 min ago
Joined: 2013-05-30 00:53
Re: How to execute embedded ARexx script?

Try with
https://www.os4depot.net/share/development/example/reaction_examples.lha
it has an ARexxExample.c that runs demo.rexx
So you can comapre and see if you have some missing part/code.

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonRX550/SSD240GB/DVDRW :-P

jap
jap's picture
Offline
Last seen: 1 week 1 day ago
Joined: 2011-06-04 05:53
Re: How to execute embedded ARexx script?

I checked the ARexxExample.c and it executes ARexx script that is on an external file. So no help there. It seems that arexx.class cannot execute "string files", i.e. scripts that are in RAM. I have to find another way to execute embedded script.

The only other option that I can think of is sending the script directly to the RexxMaster's REXX port as a RexxMsg message. The RexxMsg structure has an rm_Action member. I guess that I need to set the right value there to make it work: RXCOMM or RXFUNC?

jabirulo
jabirulo's picture
Offline
Last seen: 22 hours 59 min ago
Joined: 2013-05-30 00:53
Re: How to execute embedded ARexx script?

ok, I read wrongly, as I though you had problems when trying to execute "demo.rexx" files.

Maybe you can create such looong rexx to a file in T: and run it like "T:foobar.rexx" and then delete file.

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonRX550/SSD240GB/DVDRW :-P

Log in or register to post comments