🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.c64
Article #96

Re: User Defined Functions

#96
From: White Flame (aka David Holz)
Date: Wed, 04 Aug 1999 00:00
24 lines
1897 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: <7odh8v$3gq$2@newsread.do.de.uu.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <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: 110568,ed77fbf7dba0e36c
X-Google-Attributes: gid110568,public
X-Google-Thread: 104559,ed77fbf7dba0e36c
X-Google-Attributes: gid104559,public
X-Google-Thread: 105753,ed77fbf7dba0e36c
X-Google-Attributes: gid105753,public
X-Google-Thread: 111c73,ed77fbf7dba0e36c
X-Google-Attributes: gid111c73,public
X-Google-Thread: 159bd6,ed77fbf7dba0e36c
X-Google-Attributes: gid159bd6,public
X-Google-Thread: 14827e,ed77fbf7dba0e36c
X-Google-Attributes: gid14827e,public
From: "White Flame (aka David Holz)" <white-flameParrot@geocities.KillTheParrot.com>
Subject: Re: User Defined Functions
Date: 1999/08/04
Message-ID: <7odh8v$3gq$2@newsread.do.de.uu.net>
X-Deja-AN: 509421579
References: <tr7p3.37156$YW5.3367@news.rdc1.pa.home.com>
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
X-Complaints-To: abuse@de.uu.net
Organization: Network Access Services, Inc.
X-MSMail-Priority: Normal
NNTP-Posting-Date: 6 Aug 1999 02:28:47 GMT
Newsgroups: alt.c64,bit.listserv.coco,comp.sys.cbm,fidonet.cbm,fidonet.cbm-geos,fidonet.coco