[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Integer BASIC's "*** NO END ERR"
- Subject: Re: Integer BASIC's "*** NO END ERR"
- From: "anoneds@netscape.net" <anoneds@netscape.net>
- Date: 26 Jun 2005 19:23:57 -0700
- Complaints-to: groups-abuse@google.com
- In-reply-to: <LxHve.4686$mw1.3996@trnddc09>
- Injection-info: o13g2000cwo.googlegroups.com; posting-host=65.149.32.110; posting-account=eL7mewwAAABmqqXELpgC8WibfFSSqJXz
- Newsgroups: comp.sys.apple2
- Organization: http://groups.google.com
- References: <d9k9j5$i6h$1@ottoman.cs.fiu.edu> <2xkve.2045$p%3.14733@typhoon.sonic.net> <MPG.1d291423800d264d9896c9@news.individual.net> <LxHve.4686$mw1.3996@trnddc09>
- User-agent: G2/0.2
- Xref: g2news1.google.com comp.sys.apple2:12488
Joshua Bell wrote:
> Paul Schlyter wrote:
>
> > You must put an end to programs in other programming languages too.
> > If you omit the final END from a Pascal or FORTRAN program, or the
> > final closing brace from a C, C++, Java or C# program, the compilers
> > will treat this as a compilation error, forcing you to add the
> > missing END (or final closing brace), and recompile.
>
> The END statement is more akin to an exit() call (in C/C++) than a closing
> brace. An exit() call means "terminate execution now".
>
> In compiled languages like C/C++, braces (etc) are part of the syntax, and
> are (usually) strictly required. The use of statements like END or calls
> like exit() are simply part of the language's runtime services, and can
> hardly be required - many programs never stop! (Although on modern systems
> they usually have some contract with the OS to be asked to shut down
> nicely.)
>
> In most interpreted languages - like JavaScript, shell/batch files, Perl,
> etc - no explicit "end" statement is required. When the interpreter runs out
> of things to interpret, it stops nicely and hands execution back to the
> host.
>
> (Nothing wrong with Integer Basic's requirement for END - it probably cut
> down on errors when subroutines were later added to the "end" of the source.
> I'm certain I made mistakes like that.)
IMHO, it is a good requirement. I've often done exactly what you said -
added subroutines to a program only to have it give me "Return without
gosub". Usually while typing copy in, I like to key in the subroutines
as they are called in the mainline so I can test it as I go...
Ben