<div dir="ltr">Hi Tabish,<div><br></div><div>The error tells you what&#39;s wrong. The function &#39;new&#39; is used to define the dimensions of a new variable and the variable type, not to assign the contents of the array. See the documentation here:</div><div><br></div><div><a href="http://ncl.ucar.edu/Document/Functions/Built-in/new.shtml">http://ncl.ucar.edu/Document/Functions/Built-in/new.shtml</a><br></div><div><br></div><div>So using your example above, you could do one of the following:</div><div><br></div><div>a = new(12, string)</div><div>a = (/<span style="color:rgb(0,0,255);font-family:&#39;trebuchet ms&#39;,sans-serif;font-size:12.8px">&quot;0530&quot;,&quot;0730&quot;,&quot;0930&quot;,&quot;</span><span style="color:rgb(0,0,255);font-family:&#39;trebuchet ms&#39;,sans-serif;font-size:12.8px">1130&quot;,&quot;1330&quot;,&quot;1530&quot;,&quot;1730&quot;,&quot;</span><span style="color:rgb(0,0,255);font-family:&#39;trebuchet ms&#39;,sans-serif;font-size:12.8px">1930&quot;,&quot;2130&quot;,&quot;2330&quot;,&quot;0130&quot;,&quot;</span><span style="color:rgb(0,0,255);font-family:&#39;trebuchet ms&#39;,sans-serif;font-size:12.8px">0330&quot;</span>/)</div><div><br></div><div>And in the example above, you wouldn&#39;t even need to define &#39;a&#39; with the &#39;new&#39; function. You could simply assign the array of strings to &#39;a&#39; without first defining it.</div><div><br></div><div>I hope that helps get you pointed in the right direction.</div><div><br></div><div>Jared</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Dec 12, 2015 at 5:52 PM, Tabish Ansari <span dir="ltr">&lt;<a href="mailto:tabishumaransari@gmail.com" target="_blank">tabishumaransari@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Hi<br><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">I am trying to use a string array inside an XY plot. This is to represent time on the x-axis. I am using the following line:<br><br><span style="color:rgb(0,0,255)">a = new((/&quot;0530&quot;,&quot;0730&quot;,&quot;0930&quot;,&quot;1130&quot;,&quot;1330&quot;,&quot;1530&quot;,&quot;1730&quot;,&quot;1930&quot;,&quot;2130&quot;,&quot;2330&quot;,&quot;0130&quot;,&quot;0330&quot;/),string)</span><br><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">However, I am getting this error message:<br><b>fatal:New: the dimension size parameter is the wrong type an integer value was expected<br><br></b></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">What am I doing wrong here?<br><br><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Thanks in advance!<br><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Tabish<br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><b></b></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br clear="all"></div><div><div><div dir="ltr"><div><div><font size="1"><span style="font-family:tahoma,sans-serif">Tabish U Ansari<br></span></font></div><font size="1"><span style="font-family:tahoma,sans-serif">PhD student, Lancaster Environment Center<br></span></font></div><font size="1"><span style="font-family:tahoma,sans-serif">Lancaster Univeristy<br> <span>Bailrigg</span>, <span>Lancaster</span>, <br><span>LA1 4YW</span>, <span>United Kingdom</span></span></font><br></div></div></div>
</div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div><div><div><div><font face="courier new, monospace">===============================<br>Jared A. Lee, Ph.D.<br></font></div><font face="courier new, monospace">Project Scientist I<br></font></div><font face="courier new, monospace">Research Applications Laboratory<br></font></div><font face="courier new, monospace">National Center for Atmospheric Research<br>Boulder, Colorado, USA<br><br></font></div><font face="courier new, monospace">Email: <a href="mailto:jaredlee@ucar.edu" target="_blank">jaredlee@ucar.edu</a> (w)<br></font></div><font face="courier new, monospace">Phone: 303.497.8485 (w)</font><div><font face="courier new, monospace">Web: <a href="https://staff.ucar.edu/users/jaredlee" target="_blank">https://staff.ucar.edu/users/jaredlee</a><br>===============================</font><br></div></div></div>
</div>