Kevin asks: �Do I need to put a U IO before every write in the REPORT function?�
Well, every time you get into a car, you don�t NEED to buckle up. It is, however, a wise choice to make. Likewise, you don�t NEED to preface every WRITE command with a USE command. It is, however, also a wise choice to make. If you wish to guarantee that a WRITE command is directed to the device that you intend when that WRITE command executes, for now and ever more, then as a matter of self protection it is prudent to preface that WRITE with a USE. This is a matter of programming �style�, not a requirement imposed by the M language. It is often the case that M code is slowly evolved over extended intervals of time. As one writes code today, it is good form to presume that this code may be executed in circumstances that are not foreseeable. The M language in particular makes this a highly probable occurrence. Most of us have seen the day that a WRITE command. Intended to write to a display device, sent output to a tape or disk file, quietly and without immediately noticeable effects. Only later, when that errant data interferes with some other operation does the errant output become apparent, often with very painful consequences. Also, the USE command is "global" in its context of effect. When a given instance of the WRITE command executes, the device that receives that output will always the the one specified by the most recent USE command executed in that execution environment. It does not matter what line of code contained that USE command, just that it is most recently executed USE. This is the technical reason for protecting each WRITE command with a preceding USE command. Regards, Richard. ========================================================================== From: Kevin Toppenberg <[EMAIL PROTECTED]> Reply-To: [email protected] Date: Wed, 23 Feb 2005 08:11:26 -0800 (PST) To: [email protected] Subject: Re: [Hardhats-members] How to properly use ^%ZIS ?? 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 ... .... ..... ...... ------------------------------------------------------- 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_ide95&alloc_id396&op=click _______________________________________________ Hardhats-members mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/hardhats-members
