Connecting Tech Pros Worldwide Forums | Help | Site Map

jmol using applet with perl programming

Newbie
 
Join Date: Jan 2007
Posts: 4
#1: Jan 23 '07
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=\"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;\">
}
<param name=\"progressbar\" 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.

Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#2: Jan 23 '07

re: jmol using applet with perl programming


Quote:

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=\"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;\">
}
<param name=\"progressbar\" 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
KevinADC's Avatar
Expert
 
Join Date: Jan 2007
Location: Southern California USA
Posts: 4,091
#3: Jan 23 '07

re: jmol using applet with perl programming


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

<param name=\"progressbar\" 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:

Expand|Select|Wrap|Line Numbers
  1. print "<applet name=\"jmol\" code=\"JmolApplet\" archive=\"../../jmol-10.2.0/JmolApplet.jar\"
  2. width=\"500\" height=\"500\">";
  3. print "<param name=\"load\" value=\"../../jmol-10.2.0/$pdbidsiva;\">";
  4. foreach(@value)
  5. {
  6. 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;\">";
  7. }
  8. print "<param name=\"progressbar\" value=\"true\">";
  9. print "<param name=\"bgcolor\" value=\"black\">";
  10. print "</applet>";
  11.  
look into using the qq operator for printing your double-quoted strings. Makes all that messy escaping of embedded double-quotes unecessary.
Reply


Similar Perl bytes