<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re:  Possible Alpha BASIC 1.6 compiler problem? in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/possible-alpha-basic-1-6-compiler-problem/m-p/4587552#M39530</link>
    <description>When this project started way-back-when, I suggested Pascal but was over-ruled so my only option is to make BASIC much more strict.&lt;BR /&gt;&lt;BR /&gt;To your question, since the external string function "dt_stamp" was declared without a parameter list -AND- I had invoked "option=type=explicit", I mistakenly assumed that the compiler would complain whenever I called this function with parameters. This did not happen which means I eventually encountered a run-time error.&lt;BR /&gt;&lt;BR /&gt;From the feedback on comp.os.vms I think the only way out is to declare a null parameter list like so:&lt;BR /&gt;&lt;BR /&gt;external string function dt_stamp()&lt;BR /&gt;&lt;BR /&gt;and assume it will always be future proof.&lt;BR /&gt;</description>
    <pubDate>Sun, 21 Feb 2010 21:22:53 GMT</pubDate>
    <dc:creator>Neil Rieck</dc:creator>
    <dc:date>2010-02-21T21:22:53Z</dc:date>
    <item>
      <title>Possible Alpha BASIC 1.6 compiler problem?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/possible-alpha-basic-1-6-compiler-problem/m-p/4587549#M39527</link>
      <description>&lt;!--!*#--&gt;This week I ran into a problem which I caused three weeks ago (typo) but the Alpha BASIC compiler did not catch. (See the comment "typo"&lt;BR /&gt;below). However, the call still failed at run time when triggered by customer data.&lt;BR /&gt;&lt;BR /&gt;So here is my question:&lt;BR /&gt;1) Since I was using "option type=explicit" is the compiler at fault?&lt;BR /&gt;2) should I have declared "dt_stamp" as "dt_stamp()" ?&lt;BR /&gt;3) will using "dt_stamp()" be future-proof?&lt;BR /&gt;&lt;BR /&gt;Neil Rieck&lt;BR /&gt;Waterloo, Ontario, Canada.&lt;BR /&gt;&lt;BR /&gt;1000    !============================================================&lt;BR /&gt;        ! title   : alpha_basic_16_compiler_problem.bas&lt;BR /&gt;        ! author  : Neil Rieck&lt;BR /&gt;        ! created : 2010-02-19&lt;BR /&gt;        ! note    : tested using "Alpha BASIC V1.6-000"&lt;BR /&gt;        ! dcl     : $bas/optim=level=0/lis     -&lt;BR /&gt;        !                  alpha_basic_16_compiler_problem.bas&lt;BR /&gt;        !============================================================&lt;BR /&gt;        option type=explicit                            !&lt;BR /&gt;        !&lt;BR /&gt;        !       should this next line be changed to: "dt_stamp()"&lt;BR /&gt;        !       and will it be future proof?&lt;BR /&gt;        !&lt;BR /&gt;        external string function dt_stamp               !&lt;BR /&gt;ccyymmddhhmmss&lt;BR /&gt;        external string function html_escape(string)    !&lt;BR /&gt;        external string function html_unescape(string)  !&lt;BR /&gt;        !&lt;BR /&gt;        declare string buff1$, buff2$, buff3$           !&lt;BR /&gt;        !&lt;BR /&gt;2000    while 1                                         !&lt;BR /&gt;            print "enter something (blank to exit)";    !&lt;BR /&gt;            linput buff1$                               !&lt;BR /&gt;            goto fini if buff1$ = ""                    ! exit on&lt;BR /&gt;blank&lt;BR /&gt;            print "date+time&amp;gt;"; dt_stamp                !&lt;BR /&gt;            buff2$ = html_escape(buff1$)                !&lt;BR /&gt;!~~~        buff3$ = html_unescape(buff2$)              x intended&lt;BR /&gt;line&lt;BR /&gt;            !&lt;BR /&gt;            !   this next line is not what I intended...&lt;BR /&gt;            !   ...but the compiler did not complain&lt;BR /&gt;            !&lt;BR /&gt;            buff3$ = dt_stamp(buff2$)                   ! typo line&lt;BR /&gt;            if buff2$ &amp;lt;&amp;gt; buff3$ then                    !&lt;BR /&gt;                print "-e- conversion error"            !&lt;BR /&gt;                print "    Org: "+ buff1$               !&lt;BR /&gt;                print "    Esc: "+ buff2$               !&lt;BR /&gt;                print "    Une: "+ buff3$               !&lt;BR /&gt;            end if                                      !&lt;BR /&gt;        next                                            !&lt;BR /&gt;        !&lt;BR /&gt;30000   fini:                                           !&lt;BR /&gt;            print "-i-exiting"                          !&lt;BR /&gt;        end                                             !</description>
      <pubDate>Sat, 20 Feb 2010 14:20:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/possible-alpha-basic-1-6-compiler-problem/m-p/4587549#M39527</guid>
      <dc:creator>Neil Rieck</dc:creator>
      <dc:date>2010-02-20T14:20:29Z</dc:date>
    </item>
    <item>
      <title>Re:  Possible Alpha BASIC 1.6 compiler problem?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/possible-alpha-basic-1-6-compiler-problem/m-p/4587550#M39528</link>
      <description>This question is a cross-post from comp.os.vms.&lt;BR /&gt;&lt;BR /&gt;The question itself was not clear to me on first reading, but was later clarified in c.o.v.&lt;BR /&gt;The key is question #2.&lt;BR /&gt;&lt;BR /&gt;Declaring a function without argument list, allows any argument list.&lt;BR /&gt;Declaring a function with an empty argument list, only allows it to be called without argument. If the program does provide an argument it'll get the error:&lt;BR /&gt;&lt;BR /&gt;%BASIC-E-PAREXPFOR, 0 parameters expected for DT_STAMP&lt;BR /&gt;&lt;BR /&gt;This is NOT documented, but seems perfectly natural.&lt;BR /&gt;&lt;BR /&gt;1) Since I was using "option type=explicit" is the compiler at fault?&lt;BR /&gt;&lt;BR /&gt;No, you did not articulate arguments, or the lack thereof, suggesting freedom of choice.&lt;BR /&gt;&lt;BR /&gt;2) should I have declared "dt_stamp" as "dt_stamp()" ?&lt;BR /&gt;&lt;BR /&gt;Yes, if it should not have an argument and you'd like the compiler to ensure that.&lt;BR /&gt;&lt;BR /&gt;3) will using "dt_stamp()" be future-proof?&lt;BR /&gt;&lt;BR /&gt;Yes. &lt;BR /&gt;a) the behavior makes sense.&lt;BR /&gt;b) there is no active development.&lt;BR /&gt;&lt;BR /&gt;Basic has been in maintenance mode of a decade or more best I can tell.&lt;BR /&gt;&lt;BR /&gt;Like you indicate in c.o.v, maybe an official  HP person will give and unofficial answer here. That could happen, but I doubt it.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Hein&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 21 Feb 2010 05:46:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/possible-alpha-basic-1-6-compiler-problem/m-p/4587550#M39528</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2010-02-21T05:46:21Z</dc:date>
    </item>
    <item>
      <title>Re:  Possible Alpha BASIC 1.6 compiler problem?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/possible-alpha-basic-1-6-compiler-problem/m-p/4587551#M39529</link>
      <description>Neil,&lt;BR /&gt;&lt;BR /&gt;  When you want to report a problem, it's a good idea to post the actual behaviour you're observing, and what you're expecting.&lt;BR /&gt;&lt;BR /&gt;  Having done language support for several decades, I can tell you that it's fairly rare (but not impossible) that perceived misbehaviour is a compiler error.  Compiler bugs therefore fall into the Carl Sagan category of "extraordinary claims".&lt;BR /&gt;&lt;BR /&gt;  Of all the languages available on OpenVMS, C and Basic tend to generate the most "compiler bug" reports, when it's really a misunderstanding of the language. Basic, although it's supposed to be a simple language, does LOTS of extra stuff you probably don't know about. Even the most innocuous statement can generate along sequence of type conversions and apparently extraneous operations. In almost all cases it's necessary to conform to the language definition, but it's not always what the programmer intended.&lt;BR /&gt;&lt;BR /&gt;  Next time you find something like this, please strip it down even further. Eliminate all I/O statements (they generate LOTS of code), and examine the output of /LIST/MACHINE to see what the compiler is really doing.&lt;BR /&gt;&lt;BR /&gt;  I don't have a Basic compiler, so I can't check, but I'd have thought something like:&lt;BR /&gt;&lt;BR /&gt;1000 option type=explicit     &lt;BR /&gt;     external string function dt_stamp &lt;BR /&gt;     declare string buff1$, buff2$&lt;BR /&gt;     buff1$=dt_stamp&lt;BR /&gt;     buff2$=dt_stamp(buff1$)&lt;BR /&gt;     end&lt;BR /&gt;&lt;BR /&gt;should show you what the compiler is really doing.&lt;BR /&gt;&lt;BR /&gt;"BASIC compiler did not catch."&lt;BR /&gt; &lt;BR /&gt;Don't expect BASIC to "catch" errors. The language is far more oriented towards "do what I (think you) mean" than "make sure the program is correct". If you want a compiler which keeps you on the straight and narrow, switch to Pascal or Ada. &lt;BR /&gt;</description>
      <pubDate>Sun, 21 Feb 2010 21:10:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/possible-alpha-basic-1-6-compiler-problem/m-p/4587551#M39529</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2010-02-21T21:10:30Z</dc:date>
    </item>
    <item>
      <title>Re:  Possible Alpha BASIC 1.6 compiler problem?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/possible-alpha-basic-1-6-compiler-problem/m-p/4587552#M39530</link>
      <description>When this project started way-back-when, I suggested Pascal but was over-ruled so my only option is to make BASIC much more strict.&lt;BR /&gt;&lt;BR /&gt;To your question, since the external string function "dt_stamp" was declared without a parameter list -AND- I had invoked "option=type=explicit", I mistakenly assumed that the compiler would complain whenever I called this function with parameters. This did not happen which means I eventually encountered a run-time error.&lt;BR /&gt;&lt;BR /&gt;From the feedback on comp.os.vms I think the only way out is to declare a null parameter list like so:&lt;BR /&gt;&lt;BR /&gt;external string function dt_stamp()&lt;BR /&gt;&lt;BR /&gt;and assume it will always be future proof.&lt;BR /&gt;</description>
      <pubDate>Sun, 21 Feb 2010 21:22:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/possible-alpha-basic-1-6-compiler-problem/m-p/4587552#M39530</guid>
      <dc:creator>Neil Rieck</dc:creator>
      <dc:date>2010-02-21T21:22:53Z</dc:date>
    </item>
    <item>
      <title>Re:  Possible Alpha BASIC 1.6 compiler problem?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/possible-alpha-basic-1-6-compiler-problem/m-p/4587553#M39531</link>
      <description>&lt;BR /&gt;I don't have a Basic compiler, so I can't check, but I'd have thought something like: &lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;&lt;BR /&gt;Then let me take this opportunity to suggest you get an account at eisner.decus.org&lt;BR /&gt;&lt;BR /&gt;The signal-to-noise ration cannot be beat, although the signal count isn't really high these days&lt;BR /&gt;&lt;BR /&gt;-- Rob</description>
      <pubDate>Mon, 22 Feb 2010 04:45:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/possible-alpha-basic-1-6-compiler-problem/m-p/4587553#M39531</guid>
      <dc:creator>Robert Brooks_1</dc:creator>
      <dc:date>2010-02-22T04:45:47Z</dc:date>
    </item>
    <item>
      <title>Re:  Possible Alpha BASIC 1.6 compiler problem?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/possible-alpha-basic-1-6-compiler-problem/m-p/4587554#M39532</link>
      <description>This is a pointer to the comp.os.vms thread:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://groups.google.com/group/comp.os.vms/browse_thread/thread/50ae37fbba5bc8a0/499391ac94515b99" target="_blank"&gt;http://groups.google.com/group/comp.os.vms/browse_thread/thread/50ae37fbba5bc8a0/499391ac94515b99&lt;/A&gt;</description>
      <pubDate>Mon, 22 Feb 2010 07:22:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/possible-alpha-basic-1-6-compiler-problem/m-p/4587554#M39532</guid>
      <dc:creator>Jon Pinkley</dc:creator>
      <dc:date>2010-02-22T07:22:45Z</dc:date>
    </item>
    <item>
      <title>Re:  Possible Alpha BASIC 1.6 compiler problem?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/possible-alpha-basic-1-6-compiler-problem/m-p/4587555#M39533</link>
      <description>&lt;!--!*#--&gt;(More in reply to Hein than Neil)&lt;BR /&gt;&lt;BR /&gt;Your explanation is correct, but in fact there is an exceptional case which I believe ought be caught by the compiler and is not.&lt;BR /&gt;&lt;BR /&gt;Given:&lt;BR /&gt;        ! BUG.BAS&lt;BR /&gt;        external string function external_function( string )&lt;BR /&gt;&lt;BR /&gt;        declare string s&lt;BR /&gt;&lt;BR /&gt;        s = external_function()&lt;BR /&gt;&lt;BR /&gt;        end&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;        function string external_function( string s )&lt;BR /&gt;        end function s&lt;BR /&gt;&lt;BR /&gt;I 'd expect to get a compiler error about the wrong number of arguments.  Instead I get a run-time memory management error.&lt;BR /&gt;&lt;BR /&gt;If I add an argument to the external function:&lt;BR /&gt;&lt;BR /&gt;        ! BUG2.BAS&lt;BR /&gt;        external string function external_function( string, string )&lt;BR /&gt;&lt;BR /&gt;        declare string s&lt;BR /&gt;&lt;BR /&gt;        s = external_function()&lt;BR /&gt;&lt;BR /&gt;        end&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;        function string external_function( string s, string s2 )&lt;BR /&gt;        end function s&lt;BR /&gt;&lt;BR /&gt;I get the expected compiler error:&lt;BR /&gt;&lt;BR /&gt;        s = external_function()&lt;BR /&gt;............^&lt;BR /&gt;%BASIC-E-PAREXPFOR, 2 parameters expected for EXTERNAL_FUNCTION&lt;BR /&gt;at line number 5 in file BUG2.BAS;3&lt;BR /&gt;&lt;BR /&gt;I SPR'ed this, but the response interpreted my SPR as complaining about the run-time error, not the failure of the compiler to report the error.  My mail explaining this got no response...&lt;BR /&gt;&lt;BR /&gt;Jonathan&lt;BR /&gt;</description>
      <pubDate>Mon, 22 Feb 2010 16:53:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/possible-alpha-basic-1-6-compiler-problem/m-p/4587555#M39533</guid>
      <dc:creator>Jonathan Cronin</dc:creator>
      <dc:date>2010-02-22T16:53:06Z</dc:date>
    </item>
    <item>
      <title>Re:  Possible Alpha BASIC 1.6 compiler problem?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/possible-alpha-basic-1-6-compiler-problem/m-p/4587556#M39534</link>
      <description>If you insert "option type=explicit" at the top of your program, it will enforce parameter data types and numbers.</description>
      <pubDate>Mon, 22 Feb 2010 17:11:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/possible-alpha-basic-1-6-compiler-problem/m-p/4587556#M39534</guid>
      <dc:creator>Neil Rieck</dc:creator>
      <dc:date>2010-02-22T17:11:53Z</dc:date>
    </item>
    <item>
      <title>Re:  Possible Alpha BASIC 1.6 compiler problem?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/possible-alpha-basic-1-6-compiler-problem/m-p/4587557#M39535</link>
      <description>Neil said: "If you insert "option type=explicit" at the top of your program, it will enforce parameter data types and numbers."&lt;BR /&gt;&lt;BR /&gt;Nope, that makes no difference.  I always use type=explicit, I just was trimming the bug code to the minimal code that produced the bug.&lt;BR /&gt;&lt;BR /&gt;AFAIK, type = explicit only affects whether BASIC will assume variable type information, including individual parameters, but not parameter type checking.  That is, it checks using the assumed types.&lt;BR /&gt;&lt;BR /&gt;Jonathan&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 22 Feb 2010 19:12:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/possible-alpha-basic-1-6-compiler-problem/m-p/4587557#M39535</guid>
      <dc:creator>Jonathan Cronin</dc:creator>
      <dc:date>2010-02-22T19:12:42Z</dc:date>
    </item>
    <item>
      <title>Re:  Possible Alpha BASIC 1.6 compiler problem?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/possible-alpha-basic-1-6-compiler-problem/m-p/4587558#M39536</link>
      <description>What is the version number of your complier? (and is it VAX, Alpha, or Itanium?)</description>
      <pubDate>Mon, 22 Feb 2010 21:32:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/possible-alpha-basic-1-6-compiler-problem/m-p/4587558#M39536</guid>
      <dc:creator>Neil Rieck</dc:creator>
      <dc:date>2010-02-22T21:32:59Z</dc:date>
    </item>
    <item>
      <title>Re:  Possible Alpha BASIC 1.6 compiler problem?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/possible-alpha-basic-1-6-compiler-problem/m-p/4587559#M39537</link>
      <description>Nature of the beast! Basic was never intended to be a strongly typed language. &lt;BR /&gt;&lt;BR /&gt;"option type=explicit" &lt;BR /&gt;&lt;BR /&gt;was added to give rudimentary protection against typos in variable names, but explicit typing doesn't imply anything about argument list checking. What might be of use here is another option, perhaps "arglists=strict" (or similar). However, the chances of that happening, given the support status of the product, are vanishingly small.&lt;BR /&gt;&lt;BR /&gt;Unfortunately there are too many places where the Basic syntax for defining argument lists can't deal with all the possibilities, especially for routines in languages other than Basic. Thus, there has to be an escape mechanism to allow unchecked argument lists.  &lt;BR /&gt;&lt;BR /&gt;Basic was intended to be an "easy" programming language (oxymoron!). The reality is programming is never, and can never be "easy" for non-trivial programs.&lt;BR /&gt;&lt;BR /&gt;I've found that the very features intended to make Basic easy, actually have the reverse effect! You need to be very careful about what you write, because the compiler makes many assumptions on your behalf.</description>
      <pubDate>Mon, 22 Feb 2010 21:48:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/possible-alpha-basic-1-6-compiler-problem/m-p/4587559#M39537</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2010-02-22T21:48:35Z</dc:date>
    </item>
    <item>
      <title>Re:  Possible Alpha BASIC 1.6 compiler problem?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/possible-alpha-basic-1-6-compiler-problem/m-p/4587560#M39538</link>
      <description>re: compiler versons,&lt;BR /&gt;&lt;BR /&gt;I tested the one-argument version with Itanium 1.7, Alpha 1.7 and Vax 3.9 and got consistent results.  I tested the two argument version with both 1,7 compilers and again got consistent results.&lt;BR /&gt;&lt;BR /&gt;Jonathan</description>
      <pubDate>Tue, 23 Feb 2010 05:02:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/possible-alpha-basic-1-6-compiler-problem/m-p/4587560#M39538</guid>
      <dc:creator>Jonathan Cronin</dc:creator>
      <dc:date>2010-02-23T05:02:22Z</dc:date>
    </item>
    <item>
      <title>Re:  Possible Alpha BASIC 1.6 compiler problem?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/possible-alpha-basic-1-6-compiler-problem/m-p/4587561#M39539</link>
      <description>Same with me. While compiling with BASIC v1.6 Alpha, I get the correct behavior for testing paramater lists (param numbers as well as data types). But I do need to append a null list to functions with no expected parameters. (but as others have already suggested, this is probably the recommended technique)</description>
      <pubDate>Tue, 23 Feb 2010 13:25:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/possible-alpha-basic-1-6-compiler-problem/m-p/4587561#M39539</guid>
      <dc:creator>Neil Rieck</dc:creator>
      <dc:date>2010-02-23T13:25:41Z</dc:date>
    </item>
  </channel>
</rss>

