Welcome, Guest. Please login or register.

Author Topic: AREXX class  (Read 2968 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline SteadyTopic starter

AREXX class
« on: March 05, 2003, 01:46:47 PM »
Hello,

    I am trying to write an ARexx interface using Reaction's arexx.class under AmigaOS 3.9. Due to an extreme lack of examples, I am unable to
compare what I have done to something working. My code compiles OK, but whenever I run it, the ARexx port is not set up because it claims that I have not set the commandlist up properly. Code snippit below:

-----SNIP--------------------------------------
struct ARexxCmd arexxCmdList[] =
{
    {"QUIT", AREXX_QUIT, (void(*)())arexxQuit,
     "",
     NULL, NULL, NULL, NULL, NULL},
     {NULL}
};


void setupArexx(void)
{
 ULONG                    retVal;
 struct EasyStruct    es;

    sim.obj[OBJ_AREXX] = ARexxObject,
                                    AREXX_HostName,  AREXX_HOSTNAME,
                                    AREXX_NoSlot,    TRUE,
                                    AREXX_Commands,  arexxCmdList,
                                    AREXX_ErrorCode, &retVal,
                                    ARexxEnd;
    if(retVal)
    {
        es.es_StructSize   = sizeof(struct EasyStruct);
        es.es_Flags        = 0;
        es.es_Title        = SIM_TITLE;
        es.es_TextFormat   = AREXX_FAIL;
        es.es_GadgetFormat = "Oh... OK";
        (void)EasyRequest(NULL, &es, NULL, arexxFailMsg[retVal]);
    }
    else
        (void)GetAttr(AREXX_SigMask, sim.obj[OBJ_AREXX],
&(sim.arexxSignal));
    return;
}


void killArexx(void)
{
    if(sim.obj[OBJ_AREXX])
        DisposeObject(sim.obj[OBJ_AREXX]);
    return;
}


void arexxQuit(struct ARexxCmd *cmd, struct RexxMsg *msg)
{
    /* Not yet written, obviously, but I will set cmd & msg params to be
       registers as mentioned in arexx_cl.doc */
    return;
}
-----SNIP---------------------------------

Can someone tell me where I am  going wrong when setting up my
AREXX_Commands pointer/structure array, or if the class is just dodgy and I
should revert to the traditional method?

Any help would be great. I would like to use the newer methods if possible.
 

Offline SteadyTopic starter

Re: AREXX class
« Reply #1 on: March 05, 2003, 08:06:24 PM »
Hey, thanks a lot cygnusEd. I think you hit the nail on the head. I suspected it would be a simple error on my behalf, but sometimes you just can't see it when you look.

Cheers,
               Jason.
 

Offline SteadyTopic starter

Re: AREXX class
« Reply #2 on: March 06, 2003, 05:07:35 PM »
@ cygnusEd
Thanks for the sample code. I will have a look. Also found some in the ClassAct demo lha. Pretty obvious now I think about it. I tried the fix out last night and now have some working ARexx - yippee! My little toy is nearly finished now. Just need to do docs, install script and examples and the bulk is done. I also notice it was your first post, so welcome to amiga.org (although like me you probably lurked for ages).

Thanks again.

@ Karlos
 :-D