Article View: mod.computers.vax
Article #3732RE: Default parameter values for (BASIC) subroutines.
From: LEICHTER-JERRY
Date: Sat, 14 Mar 1987 10:16
Date: Sat, 14 Mar 1987 10:16
15 lines
1449 bytes
1449 bytes
I am writing a package of subroutines in BASIC (v2.3) and I would like to
be able to have the users who use these subroutines be able to leave
parameters out and have them default to some specified value. The
documentation is not very good in this area, but I assume it can be done
*somehow*. I know it can be done in Pascal and Macro.
I haven't really kept up with BASIC of late, so things may have changed, but
it used to be impossible to do this. The problem is that the BASIC compiler
produces code at the head of each subroutine it compiles that checks to see
if the number of arguments passed is the same as the number of arguments
expected. If not, you get an error. The other languages you mention don't
insert this check.
-- Jerry
-------
Technical Details
Message-ID:
<8703141016.AA15133@ucbvax.Berkeley.EDU>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watnot!watmath!clyde!cbatt!ucbvax!YALE.ARPA!LEICHTER-JERRYShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watnot!watmath!clyde!cbatt!ucbvax!YALE.ARPA!LEICHTER-JERRY From: LEICHTER-JERRY@YALE.ARPA.UUCP Newsgroups: mod.computers.vax Subject: RE: Default parameter values for (BASIC) subroutines. Message-ID: <8703141016.AA15133@ucbvax.Berkeley.EDU> Date: Sat, 14-Mar-87 05:16:42 EST Article-I.D.: ucbvax.8703141016.AA15133 Posted: Sat Mar 14 05:16:42 1987 Date-Received: Sat, 14-Mar-87 20:17:59 EST Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: <LEICHTER-JERRY@YALE.ARPA> Distribution: world Organization: The ARPA Internet Lines: 15 Approved: info-vax@sri-kl.arpa