Article View: alt.c64
Article #94Re: User Defined Functions
From: White Flame (aka David Holz)
Date: Wed, 04 Aug 1999 00:00
Date: Wed, 04 Aug 1999 00:00
24 lines
1815 bytes
1815 bytes
GENE EHRICH <generic3@home.com> wrote in message news:tr7p3.37156$YW5.3367@news.rdc1.pa.home.com... > I'm wondering if the Commodore VIC-20 or the Radio Shack MC-10 Color > Computer will accept user-defined functions with more than one argument > similar to the following example: > > 10 DEF FNF(X,Y)=X^2 + Y^2 > 20 PRINT FNF(3,4) [should print "25"] > 99 END > > Please let me know here and at gene@ehrich.com nope, but this would work (and is how I normally do it): 10 DEF FNF(Y)=X^2+Y^2 20 X=3:PRINT FNF(4) 99 END Actually, you could do DEF FNF(QQ)=X^2+Y^2:X=3:Y=4:PRINT FNF(.) Don't know which is faster, but functions can access all global variables. -- White Flame (aka David Holz) http://fly.to/theflame
Technical Details
Message-ID:
<7o9suc$e9b$1@barad-dur.nas.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<tr7p3.37156$YW5.3367@news.rdc1.pa.home.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 14827e,ed77fbf7dba0e36c X-Google-Attributes: gid14827e,public X-Google-Thread: 111c73,ed77fbf7dba0e36c X-Google-Attributes: gid111c73,public X-Google-Thread: 104559,ed77fbf7dba0e36c X-Google-Attributes: gid104559,public X-Google-Thread: 105753,ed77fbf7dba0e36c X-Google-Attributes: gid105753,public X-Google-Thread: 110568,ed77fbf7dba0e36c X-Google-Attributes: gid110568,public X-Google-Thread: 159bd6,ed77fbf7dba0e36c X-Google-Attributes: gid159bd6,public From: "White Flame (aka David Holz)" <white-flameParrot@geocities.KillTheParrot.com> Subject: Re: User Defined Functions Date: 1999/08/04 Message-ID: <7o9suc$e9b$1@barad-dur.nas.com> X-Deja-AN: 508882988 References: <tr7p3.37156$YW5.3367@news.rdc1.pa.home.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Organization: Network Access Services, Inc. X-MSMail-Priority: Normal Newsgroups: alt.c64,bit.listserv.coco,comp.sys.cbm,fidonet.cbm,fidonet.cbm-geos,fidonet.coco