Arbortext Command Language > Using the Arbortext Command Language > Example: Test a Document Type
  
Example: Test a Document Type
The following command notifies you if the document you are editing is a plain ASCII file rather than an SGML document:
if ($doctype=="ascii") {
message "Notice: The file you are editing \
is not an SGML document. You can still use \
Arbortext Editor to edit this file but \
you cannot enter tags.";}
The logical expression $doctype=="ascii" tests the value of the variable $doctype. If the value of this variable is ascii (that is to say, if you are editing an ASCII document), Arbortext Editor prints the warning message expressed by the message command.
You could put this in the document docname.acl file, but then you would not get the message if you switched documents with the edit command. To get around this, you could put the above if/else command in a command file called asciiwri.acl. Then put the following commands in your docname.acl file:
source asciiwri.acl
alias pub {edit $1; source asciiwri.acl;}
If you use the pub command to switch files instead of the edit command, you are notified if you have switched to an ASCII file.