In message <[email protected]>, Charlie Noah
<[email protected]> writes
John,
I can't believe you're recommending this. The only reason Universe
treats a RETURN as a STOP in a top-level program is that Universe tries
to be everything to everyone, forgiving mistakes and blunders, and
trying to determine what the user really wanted, no matter how badly
the code is written. In 1998, we converted from Universe to Jbase, and
you can't imagine all the problems we had fixing bad Universe code that
worked (sort of) so that it would work in a system that requires you to
do things correctly. When coding and breaking rules, you have to
consider that the code may be migrated someday. This is a case of "just
because you can, doesn't mean you should".
I doubt that's the case ... STOP may mean stop, but RETURN means "go
back one level". So RETURN makes perfect logical sense even in an outer
"program"...
I'm not talking about using the strengths of your particular
implementation even though they are unique to your implementation, just
doing dumb things that will bite you (or your predecessor) down the road.
I put "program" in quotes in my last paragraph, because I'm not even
sure all variants of BASIC accept the PROGRAM keyword! Certainly in my
early days programming PI I never used it, and I *think* the reason I
didn't was because it didn't exist in INFOBASIC. iirc it was added at
the same time as the FUNCTION keyword.
So I wouldn't say "John is recommending you use return", I'd say "RETURN
*always* works because subroutines should always end in a return, and at
one time everything BASIC was a subroutine". Oh - and I think PROGRAM
and SUBROUTINE are actually synonyms as far as the compiler is concerned
:-)
Just my 2 cents worth.
And my tuppence.
Cheers,
Wol
--
Anthony W. Youngman <[email protected]>
'Yings, yow graley yin! Suz ae rikt dheu,' said the blue man, taking the
thimble. 'What *is* he?' said Magrat. 'They're gnomes,' said Nanny. The man
lowered the thimble. 'Pictsies!' Carpe Jugulum, Terry Pratchett 1998
Visit the MaVerick web-site - <http://www.maverick-dbms.org> Open Source Pick
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users