[gradsusr] Get the length of a array

Davide Sacchetti davide.sacchetti at arpal.gov.it
Fri Sep 26 04:47:57 EDT 2014


it is not exactly what you are looking for, but you can use it.

Nlines=retlen(result) gives you the number of lines o result
using 'gxout print' and 'set prnopts %10.3f 1 1' you impose 10 data each
line
then all lines contain 10 data, but the last could contain between 1 and
10 data.

Possible solution: use Nlines=retlen(result) to get Nlines
use line=sublin(result,Nlines) to get last line
use Nword=linlen(line) to get how many words the last line contains

Ndata = 1*(Nlines-1) + Nword

pleese find linlen in attacch


p.s.: easier way: 'set gxout stat', 'd lon', look for 'Sizes = '

hoping it helps ...
bye bye
Davide


On Thu, 2014-09-25 at 10:06 -0700, Menaka Revel wrote:
> Hi David,
> 
> 
> I used following and I need to get number of data in lon,
> 
> 
> 'set prnopts %10.3f 1 1'
> 
> 
> 'd lon'
> 
> lon_data = result
> 
>  
> Regards,
> 
> 
> Menaka Revel
> 
> 
> 
> On Thursday, September 25, 2014 12:37 PM, Davide Sacchetti
> <davide.sacchetti at arpal.gov.it> wrote:
> 
> 
> 
> what do you mean by number of lines of an array?
> do you mean number of lines of result? (eg: how many lines is the
> result
> of 'q dims')
> if this is the case you can find a simple function to do that job
> in attachment
> 
> usage: Nlines=retlen(result)
> 
> bye bye
> Davide
> 
> On Wed, 2014-09-24 at 10:18 -0700, Menaka Revel wrote:
> > Hi,
> > 
> > 
> > Anyone knows how to get the number of lines of an array?
> > 
> >  
> > Regards,
> > 
> > 
> > Menaka Revel
> 
> > _______________________________________________
> > gradsusr mailing list
> > gradsusr at gradsusr.org
> > http://gradsusr.org/mailman/listinfo/gradsusr
> 
> -- 
> Davide Sacchetti
> Centro Funzionale Meteo Idrologico di Protezione Civile della Regione
> Liguria
> ARPAL Unità Tecnica Complessa di livello Regionale
> V.le Brigare Partigiane 2 16121 Genova (I)
> tel: +39 010 6437535                    fax: +39 010 6437520
> mail: davide.sacchetti at arpal.gov.it    web: www.meteoliguria.it
> 
> 
> 
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
> 
> 
> 
> 
> 
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr

-- 
Davide Sacchetti
Centro Funzionale Meteo Idrologico di Protezione Civile della Regione Liguria
ARPAL Unità Tecnica Complessa di livello Regionale
V.le Brigare Partigiane 2 16121 Genova (I)
tel: +39 010 6437535                    fax: +39 010 6437520
mail: davide.sacchetti at arpal.gov.it     web: www.meteoliguria.it
-------------- next part --------------
A non-text attachment was scrubbed...
Name: linlen.gsf
Type: application/x-font-type1
Size: 257 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20140926/16b434ae/attachment.bin 


More information about the gradsusr mailing list