I've used U IO(0) in several cases.  One was when I was printing labels that needed to be alligned so I'd get the device for the printing and U IO(0) for promptings to the user regarding test labels and whether they were alligned yet.  There could be many cases for prompting or informing a user while in the midst of a print process.

And as I noted earlier, U IO does not have to be on any particular line.  It becomes effective when invoked and stays effective regardless of line, routine calls, etc, until another Use statement shifts things.  I'm not sure where you got the idea that it was otherwise, but as a programmer using M and FileMan for over 20 years I can assure you that there is no such limit or "feature."

Marianne

Greg Woodhouse wrote:

That's just the way the language works. I don't particularly like that
"feature", either. And no, you don't need to USE IO(0). Off the top of
my head, I can't think of any reason an application programmer would
need to reference IO(0).

Incidentally, when %ZIS was designed, the primary use for device output
was printing reports. If you ever need to use multiple devices, you
should look at ^%ZISUTL. I find these calls useful, for example, in
working with network devices.

--- Kevin Toppenberg <[EMAIL PROTECTED]> wrote:

> Greg,
>
> Thanks for your help.
>
> I don't understand why the use only works for the current line.... oh
> well.
> Do I need to put a U IO before every write in the REPORT function?
> If the system reverts to the home device on the next line, do I need
> to U IO(0)?
>
> Thanks
> Kevin
>
>
> Greg Woodhouse <[EMAIL PROTECTED]> wrote:
> Very close. First of all, when you are done, you should close the
> device with
>
> D ^%ZISC
>
> The other point is that USE only affects the current line.
>
> U IO
> D REPORT
>
> won't work. What you need is
>
> U IO D REPORT
>
> --- Kevin Toppenberg wrote:
>
> > Hey all,
> >
> > I am writing a custom program to create a report. And
> > yes I know that templates would do this better, but I
> > don't have time to figure that system out right now.
> >
> > So I have my function that prints out everthing to the
> > screen just the way I want it (using standard
> > 'writes',and no USE's anywhere). Next, I want to be
> > able to send it to a printer device.
> >
> > So I 'do ^%ZIS'. Then I check for POP, and if
> > positive, I abort. I then 'use IO', and then I call
> > my function described above. I assume that all the
> > 'writes' should now go to the output channel, namely
> > the printer (IO). When I return from the function, I
> > 'use IO(0)' to restore the home device, and call
> > ^%ZISC.
> >
> > But still, my output goes to the screen, and my
> > printer output is empty.
> >
> > What am I doing wrong?
> >
> > Thanks
> >
> > Kevin
> >
> >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Read only the mail you want - Yahoo! Mail SpamGuard.
> > http://promotions.yahoo.com/new_mail
> >
> >
> > -------------------------------------------------------
> > SF email is sponsored by - The IT Product Guide
> > Read honest & candid reviews on hundreds of IT Products from real
> > users.
> > Discover which products truly live up to the hype. Start reading
> now.
> > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> > _______________________________________________
> > Hardhats-members mailing list
> > Hardhats-members@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/hardhats-members
> >
>
> =====
> A practical man is a man who practices the errors of his forefathers.
> --Benjamin Disraeli
> ====
> Greg Woodhouse
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
>
>
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real
> users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Hardhats-members mailing list
> Hardhats-members@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/hardhats-members
>
>
> ---------------------------------
> Do you Yahoo!?
>  Read only the mail you want - Yahoo! Mail SpamGuard.

=====
A practical man is a man who practices the errors of his forefathers. --Benjamin Disraeli
====
Greg Woodhouse
[EMAIL PROTECTED]
[EMAIL PROTECTED]

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Hardhats-members mailing list
Hardhats-members@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hardhats-members

Reply via email to