jmol using applet with perl programming

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • muruga
    New Member
    • Jan 2007
    • 4

    jmol using applet with perl programming

    hai guys,

    i am doing my work in jmol,i am using jmol applet tags with perl programming so while using jmol with in for loop it creats som problem, i don't know how to clear those problems.
    <code>
    print "<applet name=\"jmol\" code=\"JmolAppl et\" archive=\"../../jmol-10.2.0/JmolApplet.jar\ "
    width=\"500\" height=\"500\"> ";
    print "<param name=\"load\" value=\"../../jmol-10.2.0/$pdbidsiva;\">" ;
    foreach(@value)
    {
    print "<param name=\"script\" value=\"spacefi ll off;wireframe off;select $_;select not (nucleic or protein or hoh);color white;cpk 0.5;wireframe 0.2;rotate x 180;\">
    }
    <param name=\"progress bar\" value=\"true\">
    <param name=\"bgcolor\ " value=\"black\" >";
    print "</applet>";
    </code>
    while using this code it shows only the last value of that particular for loop value, other wise the value itself not displaying.
    pelase can anyone give me suggession about this thing.
    by muruga.
    Thanks in advance.
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by muruga
    hai guys,

    i am doing my work in jmol,i am using jmol applet tags with perl programming so while using jmol with in for loop it creats som problem, i don't know how to clear those problems.
    <code>
    print "<applet name=\"jmol\" code=\"JmolAppl et\" archive=\"../../jmol-10.2.0/JmolApplet.jar\ "
    width=\"500\" height=\"500\"> ";
    print "<param name=\"load\" value=\"../../jmol-10.2.0/$pdbidsiva;\">" ;
    foreach(@value)
    {
    print "<param name=\"script\" value=\"spacefi ll off;wireframe off;select $_;select not (nucleic or protein or hoh);color white;cpk 0.5;wireframe 0.2;rotate x 180;\">
    }
    <param name=\"progress bar\" value=\"true\">
    <param name=\"bgcolor\ " value=\"black\" >";
    print "</applet>";
    </code>
    while using this code it shows only the last value of that particular for loop value, other wise the value itself not displaying.
    pelase can anyone give me suggession about this thing.
    by muruga.
    Thanks in advance.
    Sounds like some flaw in the perl statements logic rather than something to do with Java programming statements so I'm copying this to the perl forum

    Comment

    • KevinADC
      Recognized Expert Specialist
      • Jan 2007
      • 4092

      #3
      that code looks like it shouldn't even run. Several syntax errors. Like what are these two lines doing?

      <param name=\"progress bar\" value=\"true\">
      <param name=\"bgcolor\ " value=\"black\" >";

      and the print line inside the foreach loop is missing the terminating double-quote on the end of the string. Maybe it should be:

      Code:
      print "<applet name=\"jmol\" code=\"JmolApplet\" archive=\"../../jmol-10.2.0/JmolApplet.jar\"
      width=\"500\" height=\"500\">";
      print "<param name=\"load\" value=\"../../jmol-10.2.0/$pdbidsiva;\">";
      foreach(@value)
      {
      print "<param name=\"script\" value=\"spacefill off;wireframe off;select $_;select not (nucleic or protein or hoh);color white;cpk 0.5;wireframe 0.2;rotate x 180;\">";
      }
      print "<param name=\"progressbar\" value=\"true\">";
      print "<param name=\"bgcolor\" value=\"black\">";
      print "</applet>";
      look into using the qq operator for printing your double-quoted strings. Makes all that messy escaping of embedded double-quotes unecessary.

      Comment

      Working...