Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #33097
| Newsgroups | comp.lang.javascript |
|---|---|
| Date | 2017-04-23 09:49 -0700 |
| References | (3 earlier) <013aedad-faa3-4207-92bf-6c18ef764969@googlegroups.com> <or39fcp5eirh6t4tht3kjusp4jjg9hjskt@4ax.com> <Y8adncdLCZowRmbFnZ2dnUU7-V3NnZ2d@westnet.com.au> <3191717e-3652-45ad-a526-86f07b74f6d5@googlegroups.com> <9depfctc9stkatqhtk8b5g6v8g754bda0u@4ax.com> |
| Message-ID | <044928be-2a3a-44cd-a2db-8f4bb4f90157@googlegroups.com> (permalink) |
| Subject | Re: Javascripts and highlevel computer language programming of graphics |
| From | jonas.thornvall@gmail.com |
Den söndag 23 april 2017 kl. 16:29:26 UTC+2 skrev John G Harris:
> On Sat, 22 Apr 2017 15:46:53 -0700 (PDT), jonas.thornvall@gmail.com
> wrote:
>
> >Den söndag 23 april 2017 kl. 00:39:50 UTC+2 skrev RobG:
> >> On 17/04/2017 19:49, John G Harris wrote:
> >> [...]
> >> > For the paint_graph function it looks as though only one of the
> >> > markers can be true at a time. You could use a code instead and use it
> >> > to address an array of functions.
> >> >
> >> > var fd = [markDraw, moveDraw, boundariesDraw, reshapeDraw];
> >> >
> >> > // if m is the code, call the required function by :
> >> > fd.m();
> >>
> >> Or if "m is the code" means m is a variable to which the code is
> >> assigned, then perhaps:
> >>
> >> var m = /* expression to generate required code */
> >>
> >> fd[m]();
> <snip>
>
> Sorry Jonas, I must have written it in a hurry. The dot notation can't
> be used for this purpose.
>
> Here are two examples that work.
> First, using an array.
>
> /***************/
> function al(){return "alpha"};
> function be(){return "beta"};
> function ga(){return "gamma"};
>
> var fd = [al, be, ga];
> var m;
>
> m = 1;
> alert( fd[m]() );
>
> m = 2;
> alert( fd[m]() );
> /***************/
>
>
> Second, using an object.
>
> /***************/
> function fal(){return "alpha"};
> function fbe(){return "beta"};
> function fga(){return "gamma"};
>
> var fd = {al: fal, be: fbe, ga: fga};
> var m;
>
> m = "be";
> alert( fd[m]() );
>
> m = "ga";
> alert( fd[m]() );
> /***************/
>
> John
You would make a great teacher John
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Javascripts and highlevel computer language programming of graphics jonas.thornvall@gmail.com - 2017-04-14 11:49 -0700
Re: Javascripts and highlevel computer language programming of graphics John G Harris <niam@jghnorth.org.uk.invalid> - 2017-04-15 11:07 +0100
Re: Javascripts and highlevel computer language programming of graphics jonas.thornvall@gmail.com - 2017-04-15 11:52 -0700
Re: Javascripts and highlevel computer language programming of graphics jonas.thornvall@gmail.com - 2017-04-15 12:04 -0700
Re: Javascripts and highlevel computer language programming of graphics jonas.thornvall@gmail.com - 2017-04-15 14:52 -0700
Re: Javascripts and highlevel computer language programming of graphics jonas.thornvall@gmail.com - 2017-04-15 15:04 -0700
Re: Javascripts and highlevel computer language programming of graphics "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-04-16 00:09 +0200
Re: Javascripts and highlevel computer language programming of graphics jonas.thornvall@gmail.com - 2017-04-15 15:18 -0700
Re: Javascripts and highlevel computer language programming of graphics "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-04-16 11:27 +0200
Re: Javascripts and highlevel computer language programming of graphics <cyber@2trom.com> - 2017-04-16 15:08 +0000
Re: Javascripts and highlevel computer language programming of graphics "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-04-16 20:47 +0200
Re: Javascripts and highlevel computer language programming of graphics Gene Wirchenko <genew@telus.net> - 2017-04-17 10:02 -0700
Re: Javascripts and highlevel computer language programming of graphics "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-04-17 23:46 +0200
Re: Javascripts and highlevel computer language programming of graphics Gene Wirchenko <genew@telus.net> - 2017-04-18 17:39 -0700
Re: Javascripts and highlevel computer language programming of graphics Andrew Poulos <ap_prog@hotmail.com> - 2017-04-19 11:25 +1000
Re: Javascripts and highlevel computer language programming of graphics Bob Martin <bob.martin@excite.com> - 2017-04-19 07:30 +0100
Re: Javascripts and highlevel computer language programming of graphics "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-04-19 12:13 +0200
Re: Javascripts and highlevel computer language programming of graphics Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-04-19 13:58 +0200
Re: Javascripts and highlevel computer language programming of graphics "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-04-19 17:20 +0200
Re: Javascripts and highlevel computer language programming of graphics Gene Wirchenko <genew@telus.net> - 2017-04-19 10:00 -0700
Re: Javascripts and highlevel computer language programming of graphics <cyber@2trom.com> - 2017-04-20 12:33 +0000
Re: Javascripts and highlevel computer language programming of graphics Gene Wirchenko <genew@telus.net> - 2017-04-20 11:39 -0700
Re: Javascripts and highlevel computer language programming of graphics "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-04-20 21:24 +0200
Re: Javascripts and highlevel computer language programming of graphics Gene Wirchenko <genew@telus.net> - 2017-04-21 11:57 -0700
Re: Javascripts and highlevel computer language programming of graphics Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-04-21 18:37 +0200
Re: Javascripts and highlevel computer language programming of graphics "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-04-19 12:00 +0200
Re: Javascripts and highlevel computer language programming of graphics Gene Wirchenko <genew@telus.net> - 2017-04-19 10:03 -0700
Re: Javascripts and highlevel computer language programming of graphics "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-04-20 00:07 +0200
Re: Javascripts and highlevel computer language programming of graphics Gene Wirchenko <genew@telus.net> - 2017-04-19 17:21 -0700
Re: Javascripts and highlevel computer language programming of graphics Andrew Poulos <ap_prog@hotmail.com> - 2017-04-20 15:54 +1000
Re: Javascripts and highlevel computer language programming of graphics "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-04-20 08:46 +0200
Re: Javascripts and highlevel computer language programming of graphics "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-04-20 08:43 +0200
Re: Javascripts and highlevel computer language programming of graphics Gene Wirchenko <genew@telus.net> - 2017-04-20 11:42 -0700
Re: Javascripts and highlevel computer language programming of graphics "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-04-20 21:37 +0200
Re: Javascripts and highlevel computer language programming of graphics jonas.thornvall@gmail.com - 2017-04-21 03:23 -0700
Re: Javascripts and highlevel computer language programming of graphics Andrew Poulos <ap_prog@hotmail.com> - 2017-04-22 16:21 +1000
Re: Javascripts and highlevel computer language programming of graphics "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-04-22 12:15 +0200
Re: Javascripts and highlevel computer language programming of graphics Gene Wirchenko <genew@telus.net> - 2017-04-21 11:58 -0700
Re: Javascripts and highlevel computer language programming of graphics <cyber@2trom.com> - 2017-04-17 13:01 +0000
Re: Javascripts and highlevel computer language programming of graphics Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-04-17 20:28 +0200
Re: Javascripts and highlevel computer language programming of graphics bit-naughty@hotmail.com - 2017-04-19 23:50 -0700
Re: Javascripts and highlevel computer language programming of graphics Andrew Poulos <ap_prog@hotmail.com> - 2017-04-20 19:02 +1000
Re: Javascripts and highlevel computer language programming of graphics "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-04-20 11:24 +0200
Re: Javascripts and highlevel computer language programming of graphics jonas.thornvall@gmail.com - 2017-04-15 15:14 -0700
Re: Javascripts and highlevel computer language programming of graphics jonas.thornvall@gmail.com - 2017-04-15 15:24 -0700
Re: Javascripts and highlevel computer language programming of graphics John G Harris <niam@jghnorth.org.uk.invalid> - 2017-04-17 10:49 +0100
Re: Javascripts and highlevel computer language programming of graphics RobG <rgqld@iinet.net.au> - 2017-04-23 08:39 +1000
Re: Javascripts and highlevel computer language programming of graphics jonas.thornvall@gmail.com - 2017-04-22 15:46 -0700
Re: Javascripts and highlevel computer language programming of graphics John G Harris <niam@jghnorth.org.uk.invalid> - 2017-04-23 15:29 +0100
Re: Javascripts and highlevel computer language programming of graphics jonas.thornvall@gmail.com - 2017-04-23 09:47 -0700
Re: Javascripts and highlevel computer language programming of graphics jonas.thornvall@gmail.com - 2017-04-23 09:57 -0700
Re: Javascripts and highlevel computer language programming of graphics John G Harris <niam@jghnorth.org.uk.invalid> - 2017-04-24 11:09 +0100
Re: Javascripts and highlevel computer language programming of graphics jonas.thornvall@gmail.com - 2017-04-24 05:26 -0700
Re: Javascripts and highlevel computer language programming of graphics jonas.thornvall@gmail.com - 2017-04-24 05:32 -0700
Re: Javascripts and highlevel computer language programming of graphics jonas.thornvall@gmail.com - 2017-04-24 05:36 -0700
Re: Javascripts and highlevel computer language programming of graphics jonas.thornvall@gmail.com - 2017-04-24 05:44 -0700
Re: Javascripts and highlevel computer language programming of graphics John G Harris <niam@jghnorth.org.uk.invalid> - 2017-04-24 15:12 +0100
Re: Javascripts and highlevel computer language programming of graphics jonas.thornvall@gmail.com - 2017-04-24 10:12 -0700
Re: Javascripts and highlevel computer language programming of graphics jonas.thornvall@gmail.com - 2017-04-23 09:49 -0700
Re: Javascripts and highlevel computer language programming of graphics John G Harris <niam@jghnorth.org.uk.invalid> - 2017-04-24 11:10 +0100
Re: Javascripts and highlevel computer language programming of graphics jonas.thornvall@gmail.com - 2017-04-24 12:07 -0700
Re: Javascripts and highlevel computer language programming of graphics Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-04-24 21:24 +0100
Re: Javascripts and highlevel computer language programming of graphics jonas.thornvall@gmail.com - 2017-04-24 13:32 -0700
Re: Javascripts and highlevel computer language programming of graphics jonas.thornvall@gmail.com - 2017-04-24 13:41 -0700
Re: Javascripts and highlevel computer language programming of graphics jonas.thornvall@gmail.com - 2017-04-24 13:56 -0700
Re: Javascripts and highlevel computer language programming of graphics John G Harris <niam@jghnorth.org.uk.invalid> - 2017-04-25 10:41 +0100
Re: Javascripts and highlevel computer language programming of graphics jonas.thornvall@gmail.com - 2017-04-26 12:15 -0700
Re: Javascripts and highlevel computer language programming of graphics jonas.thornvall@gmail.com - 2017-04-24 13:27 -0700
csiph-web