<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">There is an easier way. The length of your array out[] is:<div>N = #out[] ;<br><div>HTH,</div><div>Ruth</div><div><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>--</div><div>Dr. Ir. Ruth V. Sabariego</div><div>University of Liege, Electrical Engineering & Computer Science, </div><div>Applied & Computational Electromagnetics (ACE),</div><div>phone: +32-4-3663737 - fax: +32-4-3662910 - <a href="http://ace.montefiore.ulg.ac.be/">http://ace.montefiore.ulg.ac.be/</a></div><br class="Apple-interchange-newline"><br></div></span></div></span></span>
</div>
<br><div><div>On 13 Dec 2011, at 02:13, Prakash Manandhar wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><font color="#000066"><font><font face="verdana,sans-serif">Thanks, that's exactly what I did. Regs, Prakash.<br></font></font></font><br><div class="gmail_quote">On Mon, Dec 12, 2011 at 8:04 PM, Geordie McBain <span dir="ltr"><<a href="mailto:gdmcbain@freeshell.org">gdmcbain@freeshell.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; ">2011/12/13 Prakash Manandhar <<a href="mailto:jsaaymi@gmail.com">jsaaymi@gmail.com</a>>:<br>
<div><div class="h5">> I am a newbie. Say I have the following:<br>
><br>
> h = 0.1;<br>
> out[] = Extrude {h,0,0} {<br>
> Surface{1, 5, 14, 10}; Layers{10 }; Recombine;<br>
> };<br>
><br>
> How do I get the length of the out array.<br>
<br>
</div></div>I don't know a nice way, but here's what I do:<br>
<br>
%<---<br>
Point(1) = {0, 0, 0};<br>
out[] = Extrude {1, 0, 0} { Point{1};};<br>
For i In {0:2}<br>
Printf ("out[%g] = %g", i, out[i]);<br>
EndFor<br>
--->%<br>
<br>
The message console then ends with:<br>
<br>
%<---<br>
out[0] = 2<br>
out[1] = 1<br>
Error : 'count.geo', line 4 : Uninitialized variable 'out[2]'<br>
out[2] = 0<br>
Info : Done reading 'count.geo'<br>
--->%<br>
<br>
which tells me that the length is two. Then I go back and rewrite the<br>
program knowing that. This is only any good if the length is going to<br>
be the same each time.<br>
</blockquote></div><br>
_______________________________________________<br>gmsh mailing list<br><a href="mailto:gmsh@geuz.org">gmsh@geuz.org</a><br>http://www.geuz.org/mailman/listinfo/gmsh<br></blockquote></div><br></div></div></body></html>