Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Ethan A Merritt Newsgroups: comp.graphics.apps.gnuplot Subject: Re: array index out of range Date: Wed, 21 Mar 2018 09:12:03 -0700 Organization: A noiseless patient Spider Lines: 110 Message-ID: References: <27a5038a-c936-479d-92e8-5e34a19a27e5@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit Injection-Date: Wed, 21 Mar 2018 16:12:08 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="8309303b2faf7cea1166d46236d2752a"; logging-data="26385"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19vQyme9E1I59KbUkWRs4tY" User-Agent: KNode/4.14.10 Cancel-Lock: sha1:wGkTXsbE52bQckD2l3OKd/CypdQ= Xref: csiph.com comp.graphics.apps.gnuplot:3924 olivier.gillia@gmail.com wrote: > Hello there, > > can somebody explain me this ? > > Hereafter, with 08 and 09, there is a problem : > > gnuplot> array nom_var[40] > gnuplot> > gnuplot> nom_var[01]='Date [01]' > gnuplot> nom_var[02]='P [02]' > gnuplot> nom_var[03]='T403 [03]' > gnuplot> nom_var[04]='T404 [04]' > gnuplot> nom_var[05]='M [05]' > gnuplot> nom_var[06]='666_A[06]' > gnuplot> nom_var[07]='668_C[07]' > gnuplot> nom_var[08]='667_B[08]' > ^ > array index out of range "08" would be an octal number because it begins with a "0", but 8 is not a legal character in octal numbers. So "08" evaluates to NaN (not a number), which is not a valid array index. I agree that the error message could be clearer. A simpler assignment produces a clearer message: gnuplot> N = 08 ^ unexpected or unrecognized token: 8 Ethan > > gnuplot> nom_var[09]='852_G[09]' > ^ > array index out of range > > gnuplot> nom_var[10]='851_F[10]' > gnuplot> nom_var[11]='850_E[11]' > gnuplot> nom_var[12]='849_D[12]' > gnuplot> nom_var[13]='848_G[13]' > gnuplot> nom_var[14]='847_F[14]' > gnuplot> nom_var[15]='846_E[15]' > gnuplot> nom_var[16]='845_D[16]' > gnuplot> nom_var[17]='844_G[17]' > gnuplot> nom_var[18]='843_F[18]' > gnuplot> nom_var[19]='842_E[19]' > gnuplot> nom_var[20]='841_D[20]' > gnuplot> nom_var[21]='666_A_cor[21]' > gnuplot> nom_var[22]='668_C_cor[22]' > gnuplot> nom_var[23]='667_B_cor[23]' > gnuplot> nom_var[24]='852_G_cor[24]' > gnuplot> nom_var[25]='851_F_cor[25]' > gnuplot> nom_var[26]='850_E_cor[26]' > gnuplot> nom_var[27]='849_D_cor[27]' > gnuplot> nom_var[28]='848_G_cor[28]' > gnuplot> nom_var[29]='847_F_cor[29]' > gnuplot> nom_var[30]='846_E_cor[30]' > gnuplot> nom_var[31]='845_D_cor[31]' > gnuplot> nom_var[32]='844_G_cor[32]' > gnuplot> nom_var[33]='843_F_cor[33]' > gnuplot> nom_var[34]='842_E_cor[34]' > gnuplot> nom_var[35]='841_D_cor[35]' > > Hereafter, with "8" and "9", there is no problem !!! > > gnuplot> array nom_var[40] > gnuplot> > gnuplot> nom_var[01]='Date [01]' > gnuplot> nom_var[02]='P [02]' > gnuplot> nom_var[03]='T403 [03]' > gnuplot> nom_var[04]='T404 [04]' > gnuplot> nom_var[05]='M [05]' > gnuplot> nom_var[06]='666_A[06]' > gnuplot> nom_var[07]='668_C[07]' > gnuplot> nom_var[8]='667_B[08]' > gnuplot> nom_var[9]='852_G[09]' > gnuplot> nom_var[10]='851_F[10]' > gnuplot> nom_var[11]='850_E[11]' > gnuplot> nom_var[12]='849_D[12]' > gnuplot> nom_var[13]='848_G[13]' > gnuplot> nom_var[14]='847_F[14]' > gnuplot> nom_var[15]='846_E[15]' > gnuplot> nom_var[16]='845_D[16]' > gnuplot> nom_var[17]='844_G[17]' > gnuplot> nom_var[18]='843_F[18]' > gnuplot> nom_var[19]='842_E[19]' > gnuplot> nom_var[20]='841_D[20]' > gnuplot> nom_var[21]='666_A_cor[21]' > gnuplot> nom_var[22]='668_C_cor[22]' > gnuplot> nom_var[23]='667_B_cor[23]' > gnuplot> nom_var[24]='852_G_cor[24]' > gnuplot> nom_var[25]='851_F_cor[25]' > gnuplot> nom_var[26]='850_E_cor[26]' > gnuplot> nom_var[27]='849_D_cor[27]' > gnuplot> nom_var[28]='848_G_cor[28]' > gnuplot> nom_var[29]='847_F_cor[29]' > gnuplot> nom_var[30]='846_E_cor[30]' > gnuplot> nom_var[31]='845_D_cor[31]' > gnuplot> nom_var[32]='844_G_cor[32]' > gnuplot> nom_var[33]='843_F_cor[33]' > gnuplot> nom_var[34]='842_E_cor[34]' > gnuplot> nom_var[35]='841_D_cor[35]' > > Weird !! > > Olivier