<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    On 11-08-04 08:18 AM, Jim Ianelli wrote:<br>
    <br>
    <br>
    For example in model7.cpp there is code to strip .exe from the name.<br>
    It should check that n>4<br>
    <br>
     int n=adprogram_name.size();<br>
      if (n>4)   // added this<br>
      {<br>
         if (adprogram_name(n - 3) == '.'<br>
            && adprogram_name(n - 2) == 'e'<br>
            && adprogram_name(n - 1) == 'x'<br>
            && adprogram_name(n) == 'e')<br>
        {<br>
          n -= 4;<br>
        }<br>
      }  <br>
    <br>
    <br>
    <blockquote cite="mid:000f01cc52b9$bd5b81e0$381285a0$@noaa.gov"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <meta name="Generator" content="Microsoft Word 14 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal">Recompiled ADMB from source code the other
          day and things are working ok—except that adprogram_name seems
          to be acting strangely.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">A model called “tm” (for transcendental
          mindlessness) that compiles fine and runs from within gdb
          perfectly gives the following message when run outside of gdb
          (i.e., normally):<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">tm <o:p></o:p></p>
        <p class="MsoNormal">Error: Invalid index / used for array range
          [1, 2] in "unsigned char & adstring::operator()(int i)".
          Index out of bounds<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">If I run it outside with the following: <o:p></o:p></p>
        <p class="MsoNormal">.\tm<o:p></o:p></p>
        <p class="MsoNormal">It works.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Printing out the program name (to dig
          deeper) I see that the above command (from within gdb) give:<o:p></o:p></p>
        <p class="MsoNormal">C:\Users\jianelli\Desktop\fsct/tm.exe<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">The classic windows vs unix slash war.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Oddly, if I switch to drive d: and run C:tm
          it works fine.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Not sure if this is something that is an
          easy fix but it is sure a lame error that will turn people
          away quickly if not fixable (or maybe I’m alone with this
          issue?)  I recall Buck Stockhausen had a similar naming
          convention issue that changed the behavior in a recent email.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Cheers,<o:p></o:p></p>
        <p class="MsoNormal">Jim<o:p></o:p></p>
      </div>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Developers@admb-project.org">Developers@admb-project.org</a>
<a class="moz-txt-link-freetext" href="http://lists.admb-project.org/mailman/listinfo/developers">http://lists.admb-project.org/mailman/listinfo/developers</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>