Hello,

i am a little confused about the difference between
@ and @@. according to the online manual (i know it
is not maintained by nih, but still...)  when @ is
used, content of the file is run only once on the
fist pass of the loop containing the @ statement
while @@ would make the included file to be rerun on
each pass. but i had a strange behavior with the
nested loop structure (example attached)

whenever i run the variant with the inner loop (my
example is with a double loop) included from an
external file as @@ (and keeping the comments like
they are now in loop1.inp) xplor complains ("for" -
unexpected command or something like that) - it
actually includes the file, but cannot parse it
however, the included file gets successfully parsed
and run if it does not contain a loop.(i could
include some benign statement like 'display' in the
loop2.inp and it would work fine)

but when i run the same file with the inner loop in
loop1.inp uncommented and line @@loop2.inp removed
the program runs fine, which shows that there is
nothing wrong with the logic, but the inclusion
mechanism fails for some reason.

finally, when i run the inner loop file with @ it
works. and  seems to run the included file on _each_
(not just the first one) pass of the loop, seemingly
contrary to what is said in the manual (is that right?).

one of the previous posts by John Kuszewski said
that @@ is the proper synax to use within the loops,
but i found it not working with my case. i guess i
could get around the problem by using @ instead of
@@ and make my file work, but it is still kind of
confusing when to use @@ or @. plus @@ seems to fail
only if there is a loop in the included file and is
ok otherwise .

thank you.

this is the manual entry i refer to:
-----------------------------------------------
this is from
http://atb.slac.stanford.edu/xplor/manual/node23.html#225
@@<filename>
  has the same effect as the ``@" statement, except
when the stream file is invoked within a structured
loop statement. In this case, the ``@" statement
inserts the contents of file filename into the loop
and removes the statement in subsequent loop cycles,
whereas the ``@@" statement reads from filename each
time the loop hits the statement. It should be noted
that filename can be a symbol. This allows one to
loop through a set of different filenames. Nested
``@@" statements are allowed in this release of X-PLOR.
-----------------------------------------------------

thank you!

evgeny.
-------------- next part --------------
z'µìmjÛZržžÜ²Ç+¹¶ÞtÖ¦zZ(¦×¬¶Ö«O*^jše‰Æ­Š‰ÿÆÖ«J,Þ×8é¼­zÀÞ±É赫ڊV›•å+–m§ÿÝq·"¶x¡‚‹ÿ¦*^®f¢—üi–ŠçŠڶ֜†g§¶ÏöÓN4ÛMÿs}üñÝ;þZ(¦×¬¶Ö«

Reply via email to