1 #include <proto/exec.h>
2 #include <proto/alib.h>
3 #include <proto/rexxsyslib.h>
5 #include <exec/ports.h>
6 #include <rexx/errors.h>
7 #include <rexx/storage.h>
15 struct Library
*RexxSysBase
;
18 RexxSysBase
= OpenLibrary("rexxsyslib.library", 0);
19 if (RexxSysBase
== NULL
)
21 puts("Error opening rexxsyslib.library");
25 port
= CreatePort("VARTEST", 1);
28 puts("Error creating port");
29 CloseLibrary(RexxSysBase
);
33 printf("Port created %p, waiting for message\n", port
);
35 msg
= (struct RexxMsg
*)GetMsg(port
);
36 puts("Got a message");
39 puts("Message is not a rexxmsg");
40 ReplyMsg((struct Message
*)msg
);
42 CloseLibrary(RexxSysBase
);
46 puts("Is a rexx message");
47 if (!CheckRexxMsg(msg
))
49 puts("Message is not from rexx interpreter");
50 msg
->rm_Result1
= RC_ERROR
;
51 ReplyMsg((struct Message
*)msg
);
53 CloseLibrary(RexxSysBase
);
57 puts("Message is from the rexx interpreter");
58 if (GetRexxVar(msg
, "A", &value
) != RC_OK
)
60 puts("Error during retreival of value !!");
64 printf("Length string: %d\n", (int)strlen(value
));
65 printf("Value of A: %s\n", value
);
68 SetRexxVar(msg
, "A", "2", 1);
69 msg
->rm_Result1
= RC_OK
;
71 ReplyMsg((struct Message
*)msg
);
73 CloseLibrary(RexxSysBase
);