home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!mc.bitnet!shoecraf
- From: shoecraf@mc.bitnet (Steve Shoecraft)
- Newsgroups: comp.os.vms
- Subject: re: smg$ library
- Message-ID: <01GOLY9F8TQ890OHV6@MARICOPA.EDU>
- Date: 10 Sep 92 23:37:14 GMT
- Sender: daemon@ucbvax.BERKELEY.EDU
- Distribution: world
- Organization: The Internet
- Lines: 74
- X-Unparsable-Date: Thu, 10 Sep 1992 06:16:57.66 MST
-
-
-
- > I try to call it from a COM file it acts like someone is contiuously
- > pressing the ENTER key. Anyone have any idea what could be causing
-
- This can be eliminated by defining SYS$INPUT as SYS$COMMAND in your .COM
- procedure before running your program, i.e.:
-
- $ DEFINE/USER SYS$INPUT SYS$COMMAND
-
- If you would rather your program work the same way, regardless of what
- SYS$INPUT is set to, you could call $GETJPI to get the terminal name prior to
- your call to SMG$CREATE_PASTEBOARD. Here is some sample C code that will do
- this for you:
-
- #include <jpidef.h>
-
- static char *getjpi(unsigned long);
-
- char *termname(void)
- {
- static char terminal[40];
- char *term;
- unsigned long status;
-
- term = getjpi(JPI$_TERMINAL);
- if (status & 1) {
- term[term[0]] = 0;
- sprintf(&terminal,"%s:",term+1);
- }
- else {
- terminal[0] = 0;
- strcat(terminal,"SYS$OUTPUT:");
- }
- return(&terminal);
- }
-
- static char *getjpi(unsigned long item_id)
- {
- static char ret_info[256];
- char ret_len;
- struct item {
- short buflen;
- short code;
- char *buffer;
- long *retlen;
- };
- struct item_list_3 {
- struct item info;
- struct item nullitem;
- } list = {
- { 255,item_id,&ret_info+1,&ret_len },
- { 0, 0, 0, 0 }
- };
- unsigned long status, pid = 0;
-
- ret_info[0] = 0;
- status = sys$getjpi(NULL,NULL,NULL,&list,NULL,NULL,NULL);
- if (!status & 1)
- printf("status: %x\n",status);
- ret_info[0] = ret_len;
- return(&ret_info);
- }
-
- Also, keep in mind that once you have created the pasteboard, you can then
- get information on what type of terminal you are using by calling
- SMG$GET_PASTEBOARD_ATTRIBUTES. This returns the information in a 'pasteboard
- information block', and will have stuff like the physical device type, device
- class, etc... Using this information, you can determine whether or not your
- program should continue or not... Hope this helps...
-
- Steve Shoecraft
- SHOECRAFT@MC.MARICOPA.EDU
-
-