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 %x, 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
))
60 puts("Error during retreival of value");
63 printf("Length string: %d\n", strlen(value
));
64 printf("Value of A: %s\n", value
);
66 SetRexxVar(msg
, "A", "2", 1);
67 msg
->rm_Result1
= RC_OK
;
68 msg
->rm_Result2
= NULL
;
69 ReplyMsg((struct Message
*)msg
);
71 CloseLibrary(RexxSysBase
);