SUMMARY
=======
Per Eric's request, I have implemented some special commenting conventions
for Jmol v10. These allow better interoperability between RasMol, Chime,
and Jmol scripts.

#jx denotes a command that Jmol will eXecute

#jc denotes a special type of Jmol Comment

DETAIL
======

Normally, a # denotes a comment up until the end of a statement.

A statement is terminated by a ; or by a newline

However, the following special rules now exist:

#jx commands
============
The #jx command allows the embedding of jmol statements that will be
executed by Jmol, but will be taken as comments in RasMol and Chime.

A statement starting with '#jx ' *will* be executed. The purpose of this
convention is to allow embedding of jmol-specific code into scripts that
must also run on RasMol and Chime. Take for example, the following script
fragment.

  set axes on; #jx color axes mediumOrchid

RasMol and Chime do not have the ability to control axes color. But they
will take the #jx as a comment and not croak when they see this strange
command.

WARNING! Do not try this at home! Note that Jmol does not yet support
'color axes' either ... but I hope to implement it within the next few
days :-)


#jc comments
============
The #jc comment allows the embedding of statments which will be executed
by RasMol and Chime, but will be ignored by Jmol.

If the string '#jc' appears anywhere within a statement then that entire
statement will be assumed to be a comment and will be completely ignored
by the Jmol interpreter.

This allows embedding of commands *before* the comment character. Chime
and RasMol will execute these commands. Jmol will not execute them because
it will see the #jc command at the end of the statment before executing
the statement.

For example:
  zoom 125 #jc

This would cause a zoom to 125% in RasMol and Chime.

Jmol will not execute this command because the command contains the #jc
token.

Note! The implementation of this command/hack in the parser of the Jmol
script compiler is quite simple. If you intentionally try to break it then
you *will* succeed. For example

 echo "#jc this will NOT print";

This command will *not* be executed because the #jc string was found
before the ; character.

On the other hand:
  echo "; this WILL print" #jc

Will be executed because there was a ; character found before the #jc string.

Handling these special cases is very complicated and it is not worth
investing the time to fix them. I do not believe they will come up in the
real world. If it happens ... we'll cross that bridge when we come to it.


Miguel





-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Jmol-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to