[Thread Prev][Thread Next][Index]

PPL $element() within a repeat loop



Hello Ferreters,
	I'm facing a problem while trying to get a substring using
ppl $element() within a repeat loop. To illustrate it, I'm showing a
simple journal file here:

yes? sp cat pplrep.jnl
! ppl $element within a repeat loop
 can sym/all

 def sym nplt = 2

! def sym tit = 1,2,My Title
! ppl set t3 $element(3,",",tit);

 repeat/i=1:($nplt) ( \
  def sym tit = $`i`; \
  ppl set t1 $element(1,",",tit); \
  ppl set t2 $element(2,",",tit); \
  ppl set t3 $element(3,",",tit); \
  label/nouser 2,2,0,0,0.2,@P($t1)($t3); \
  say ($t1); \
  say ($t2); \
  say ($t3); \
 )
! end of file pplrep.jnl

Now,

yes? go pplrep.jnl "1,1,First" "2,2,Second"

does not put the text ("First" or "Second"). It is clear that all the
three t1, t2 and t3 are null strings, whereas tit contains the correct
string. I'm using Ferret 5.51 in RH Linux 8.0. The same file works very
well with Ferret 5.33 for Linux 6.2 (as well in 8.0).

If I break the repeat loop into $nplt number of grouped
statements (those are within the loop), it works fine again with
Ferret 5.51 (and 5.33). But for my application the value of nplt is
supposed to change (mostly will be an input argument) and it is very
clean to use the loop instead a bunch of repeating statements of the
same kind.

Any workaround is much appreciated. Many thanks in advance.

Arindam
------------------------------------------
 ARINDAM CHAKRABORTY
 Centre for Atmospheric & Oceanic Sciences
 Indian Institute of Science
 Bangalore 560 012; INDIA
 Tel: +91-80-3942505, +91-80-3600450
 Fax: +91-80-3600865
__________________________________________



[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement