Can I see if a file exists before imbedding it?


Question

When writing a macro, I need to see if the file exists before I use the .im control word to imbed it. Can I do this?

Answer

  Write a macro to intercept the .im control word:

      .dm im on
      .sy state &*1 * *
      .if &$RET eq 0 .'im &*
      .dm off

  Your users must use the SYON command option to enable the .SY control word.

Last updated: 93/08/04 14:01:03

Previous Contents Next