From: Thomas S. <tho...@gm...> - 2008-09-22 19:02:00
|
Thanks Angel -- I have, but Jmol merely echos "null" or newline or something to the screen. I know it's echoing *something* because it paints over text that is there from an earlier echo....if I give a javascript level "alert" then I get the proper text in the pop-up window, but it's not going to the Applet for some reason.... Here's what I'm doing (in part): var headerInfo = jmolGetPropertyAsString("fileHeader"); var cutUp = headerInfo.split("\n"); var headerstring=""; for (l=0;l<cutUp.length;l++) { var regexp = new RegExp("TITLE.{5}(.*)\s*"); var temp = cutUp[l]; if (temp.search(regexp) == 0) { temp2 = RegExp.$1; temp2.replace(/^\s+|\s+$/g, "").replace(/\s+/g, " "); headerstring += temp2; } } headerstring.replace(/TITLE/, ""); alert(headerstring); jmolScript("echo @headerstring"); -Tom (It's meant to extract the TITLE lines from the PDB file header, remove the TITLE at the beginning, remove all extra whitespace, and then echo that to the Applet on loading a PDB file) On Mon, Sep 22, 2008 at 11:10 AM, Angel Herráez <ang...@ua...>wrote: > Tom, have you tried > echo @variable > ? > > That works for me in a simple test. But I'm not proficient with the use of > braces. > > |