Right -- so the important thing is to say that the first character should be
the delimiter -- it's not generally necessary, but in this case, where there
are spaces, it is, so we might as well say it is necessary.

That said, it might also be mentioned that the DATA command is much simpler
to use, and it is easier to use because one simply constructs a JavaScript
string, typically with backslash for line endings:


var script = "data \"model\"\
@<TRIPOS>MOLECULE\
Asparagine \

   10     0    0     0     0\
SMALL\
NO_CHARGES\
****\
C4H8N2O3\
@<TRIPOS>ATOM\
  1 C1          1.352237   -0.856933    0.225852 CT    1 DMSO      -0.2897\
  2 H11         1.336243   -1.843530   -0.221408 H1    1 DMSO       0.1284\
  3 H12         1.276947   -0.923392    1.304085 H1    1 DMSO       0.1284\
  4 H13         2.275139   -0.356278   -0.035153 H1    1 DMSO       0.1284\
  5 S2         -0.000004    0.136959   -0.414455 S     1 DMSO       0.3177\
  6 O3         -0.000040    1.405694    0.357557 O     1 DMSO      -0.5085\
  7 C4         -1.352189   -0.857006    0.225851 CT    1 DMSO      -0.2897\
  8 H41        -2.275117   -0.356396   -0.035149 H1    1 DMSO       0.1284\
  9 H42        -1.336143   -1.843599   -0.221415 H1    1 DMSO       0.1284\
 10 H43        -1.276895   -0.923466    1.304085 H1    1 DMSO       0.1284\
end \"model\""

jmolScript(script)

And, I've demonstrated an even easier way, using HTML comments:

<!--
--JMOL EMBED--
@<TRIPOS>MOLECULE
Asparagine

   10     0    0     0     0
SMALL
NO_CHARGES
****
C4H8N2O3
@<TRIPOS>ATOM
  1 C1          1.352237   -0.856933    0.225852 CT    1 DMSO      -0.2897
  2 H11         1.336243   -1.843530   -0.221408 H1    1 DMSO       0.1284
  3 H12         1.276947   -0.923392    1.304085 H1    1 DMSO       0.1284
  4 H13         2.275139   -0.356278   -0.035153 H1    1 DMSO       0.1284
  5 S2         -0.000004    0.136959   -0.414455 S     1 DMSO       0.3177
  6 O3         -0.000040    1.405694    0.357557 O     1 DMSO      -0.5085
  7 C4         -1.352189   -0.857006    0.225851 CT    1 DMSO      -0.2897
  8 H41        -2.275117   -0.356396   -0.035149 H1    1 DMSO       0.1284
  9 H42        -1.336143   -1.843599   -0.221415 H1    1 DMSO       0.1284
 10 H43        -1.276895   -0.923466    1.304085 H1    1 DMSO       0.1284
--JMOL EMBED--
-->

The advantage here is that you don't need any line breaks or special
character handling, and you just then use something as simple as:

jmolScript(document.body.innerHTML.split("--JMOL EMBED--\n")[1])


and you are done. So if any of that could get in there, that would be good.

Bob



On Mon, Nov 3, 2008 at 2:49 PM, Angel Herráez <[EMAIL PROTECTED]> wrote:

> On 3 Nov 2008 at 7:15, Robert Hanson wrote:
> > You need to start the model with |
> > If this is not in the wiki documentation, we need to get that there.
>
> I see nothing  about loadinline in the Wiki. Any ideas where we have it?
> There is something in the website,
> http://jmol.sourceforge.net/jslibrary/#jmolLoadInline
>
> but doesn't talk about details of the data format. Anyway, i'll take care
> of
> that.
>
> I'm quite sure of having read about the vertical line (pipe) delimiter
> somewhere.
>
>
> >
> > <param name="loadInline"
> >   value="|  4 MOPAC-Graphical data Version 2007.7.156W|
> >  8  0.0000000  0.0000000 0.0000000 -0.4225|
> >  6  1.2108153  0.0000000 0.0000000  0.2364|
> > ..." />
> >
> >
> >
> > On Mon, Nov 3, 2008 at 12:11 AM, SourceForge.net <
> [EMAIL PROTECTED]> wrote:
> >     Feature Requests item #2217513, was opened at 2008-11-03 09:46
> >     Message generated for change (Comment added) made by cpudney
> >     You can respond by visiting:
> >
> https://sourceforge.net/tracker/?func=detail&atid=379136&aid=2217513&group_id=23629
> >
> >     Please note that this message will contain a full copy of the comment
> thread,
> >     including the initial issue submission, for this request,
> >     not just the latest update.
> >     Category: None
> >     Group: None
> >     Status: Closed
> >     Priority: 5
> >     Private: No
> >     Submitted By: cpudney (cpudney)
> >     Assigned to: Bob Hanson (hansonr)
> >     Summary: loadType parameter for JmolApplet
> >
> >     Initial Comment:
> >     G'day,
> >
> >     There are instances in which the Resolver infers the wrong format for
> data passed to
> >     JmolApplet using the loadInline parameter, e.g.
> >
> >
> http://www.mail-archive.com/[EMAIL PROTECTED]/msg11466.html
> >
> >     It would be useful if it were possible to bypass the Resolver by
> specifying to the applet the
> >     format of the data in the loadInline parameter. This would mirror the
> behaviour of the
> >     "load" script command:
> >
> >     http://chemapps.stolaf.edu/jmol/docs/#load
> >
> >     One possible approach might be to add a loadType parameter which is
> passed one of the
> >     supported format identifiers. If loadType is not supplied (or is
> invalid) then the Resolver is
> >     used to determine the data format, e.g.
> >
> >     <param name="loadType"
> >       value="MopacGraphF" />
> >     <param name="loadInline"
> >       value="  4 MOPAC-Graphical data Version 2007.7.156W|
> >      8  0.0000000  0.0000000 0.0000000 -0.4225|
> >      6  1.2108153  0.0000000 0.0000000  0.2364|
> >     ..." />
> >
> >     would solve the problem in the aforementioned example.
> >
> >     The Jmol.js library could also provide an interface to this new
> parameter.
> >
> >     Thanks,
> >     Chris.
> >
> >
> ----------------------------------------------------------------------
> >
> >     Comment By: cpudney (cpudney)
> >     Date: 2008-11-03 15:11
> >
> >     Message:
> >     G'day,
> >
> >     Thanks Bob - I think the SourceForge tracker compacts white-space.
> When
> >     viewed in plain-text my original example has the same amount of
> white-space
> >     as you suggest.
> >
> >     I've experimented with varying amounts of white-space and the
> Resolver
> >     always infers FoldingXYZ, so I think we might have a bug, see
> >
> http://www.mail-archive.com/[EMAIL PROTECTED]/msg11474.html
> ,
> >     if so I close this RFE and open a bug instead.
> >
> >     Thanks,
> >     Chris.
> >
> >
> ----------------------------------------------------------------------
> >
> >     Comment By: Bob Hanson (hansonr)
> >     Date: 2008-11-03 10:09
> >
> >     Message:
> >     Chris, it's probably a good idea, but....
> >
> >     It is important to have the EXACT file format. The reason Jmol is so
> >     particular is that often if the format is incorrect, the file will be
> read
> >     incorrectly. In this case, the MOPAC specification requires:
> >
> >     Block 1, 1 line: Number of atoms (5 characters), plain text:
> >     "MOPAC-Graphical data", and version number
> >
> >     That's a bit unclear -- there's a space between the number and
> "MOPAC".
> >     That is what Jmol is looking for. You have "MOPAC" in position 4, not
> >     position 6. This should read:
> >
> >     <param name="loadInline"
> >     value="  4 MOPAC-Graphical data Version 2007.7.156W|
> >     8 0.0000000 0.0000000 0.0000000 -0.4225|
> >     6 1.2108153 0.0000000 0.0000000 0.2364|
> >     ..." />
> >
> >     Bob
> >
> >
> ----------------------------------------------------------------------
> >
> >     You can respond by visiting:
> >
> https://sourceforge.net/tracker/?func=detail&atid=379136&aid=2217513&group_id=23629
> >
> >
> -------------------------------------------------------------------------
> >     This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> >     Build the coolest Linux based applications with Moblin SDK &win great
> prizes
> >     Grand prize is a trip for two to an Open Source event anywhere in the
> world
> >     http://moblin-contest.org/redirect.php?banner_id=100&url=/
> >     _______________________________________________
> >     Jmol-developers mailing list
> >     [email protected]
> >     https://lists.sourceforge.net/lists/listinfo/jmol-developers
> >
> >
> >
> > --
> > Robert M. Hanson
> > Professor of Chemistry
> > St. Olaf College
> > 1520 St. Olaf Ave.
> > Northfield, MN 55057
> > http://www.stolaf.edu/people/hansonr
> > phone: 507-786-3107
> >
> >
> > If nature does not answer first what we want,
> > it is better to take what answer we get.
> >
> > -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
> >
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Jmol-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-developers
>



-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to