2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
6 #include <proto/exec.h>
7 #include <proto/alib.h>
8 #include <proto/rexxsyslib.h>
10 #include <exec/ports.h>
11 #include <rexx/errors.h>
12 #include <rexx/storage.h>
20 struct Library
*RexxSysBase
;
23 RexxSysBase
= OpenLibrary("rexxsyslib.library", 0);
24 if (RexxSysBase
== NULL
)
26 puts("Error opening rexxsyslib.library");
30 port
= CreatePort("VARTEST", 1);
33 puts("Error creating port");
34 CloseLibrary(RexxSysBase
);
38 printf("Port created %p, waiting for message\n", port
);
40 msg
= (struct RexxMsg
*)GetMsg(port
);
41 puts("Got a message");
44 puts("Message is not a rexxmsg");
45 ReplyMsg((struct Message
*)msg
);
47 CloseLibrary(RexxSysBase
);
51 puts("Is a rexx message");
52 if (!CheckRexxMsg(msg
))
54 puts("Message is not from rexx interpreter");
55 msg
->rm_Result1
= RC_ERROR
;
56 ReplyMsg((struct Message
*)msg
);
58 CloseLibrary(RexxSysBase
);
62 puts("Message is from the rexx interpreter");
63 if (GetRexxVar(msg
, "A", &value
) != RC_OK
)
65 puts("Error during retreival of value !!");
69 printf("Length string: %d\n", (int)strlen(value
));
70 printf("Value of A: %s\n", value
);
73 SetRexxVar(msg
, "A", "2", 1);
74 msg
->rm_Result1
= RC_OK
;
76 ReplyMsg((struct Message
*)msg
);
78 CloseLibrary(RexxSysBase
);