Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!philmtl!atha!aunro!idacom!danny From: danny@idacom.uucp (Danny Wilson) Newsgroups: comp.sys.apollo Subject: PAD Types Message-ID: <1990Feb18.230542.24066@idacom.uucp> Date: 18 Feb 90 23:05:42 GMT Organization: IDACOM Electronics Ltd. Lines: 69 A while back I ported a UNIX program to SR9.7 and enhanced its output because of the way PADs handle character output. The original (unix) program implemented a 'counting' type display by printing a number followed by a CR. (a la.. for (i=0,i<10,i++) printf("Value is %d\r", i) printf("file transfer complete\n") Running on a PAD, since all the characters would get queued up in the transcript pad, it didn't create the same effect. So, I enhanced the program to create a little window at the top of the pad to display the 'counting' numbers in. It went something like: inquire about stdout; if it is of type pad_$uid, then create a little window with frame open a stream to that window/frame put the output there else put the output to stdout However, now that we've upgraded to SR10.1, the program no longer works! The inquiry about ios_$stdout yields that it is of type "input_pad_$uid" instead of simply "pad_$uid". WHY? I can't really see why the "output" should be of type "input"... etc Has anyone out there seen this weirdness and can explain it? (Code segments below ) (lots of detail removed!) attr.strid = ios_$stdout; /* inquire about stdout */ stream_$inquire(input_mask, stream_$use_strid, attr, error, status); ob_type = attr.otype; /* now know where output is going */ /* if it's a pad, then create a little window and put the ouput there */ if (ob_type == pad_$uid) pad_$create(" ", 0, pad_$transcript, ios_$stdout, pad_$top, pad_$abs_size, 1, str_out, status); if ((ob_type == pad_$uid) || (ob_type == input_pad_$uid)) { /* create a frame to display the block count in */ pad_$create_frame(str_out, (short)80, (short)20, status); frame_id = fdopen(str_out, "w"); } else frame_id = stdout; /* block count to stdout */ for (i=0; i<5; i++) { /* only put returns if not to a file or a mailbox(crp) */ if (ob_type != mbx_$uid && ob_type != uasc_$uid) { fprintf(frame_id, "Block number %d\r", i); fflush(frame_id); } /* close frame, stream, window et al */ -- Danny Wilson danny@idacom.uucp IDACOM Electronics alberta!idacom!danny Edmonton, Alberta X.400 danny@idacom.cs.ubc.cdn C A N A D A Voice +1 403 462 4545