Post Reply 
Dynamically call a function
06-22-2015, 08:06 AM (This post was last modified: 06-22-2015 08:12 AM by Didier Lachieze.)
Post: #12
RE: Dynamically call a function
You can also avoid the CASE ... END; with something like this:

Code:
planets()
BEGIN
  LOCAL ch, nameplanet:={"Mercurius","Venus","Mars", "Jupiter", "Saturn", "Uranus", "Neptunus", "Pluto"};
  INPUT({{ch, nameplanet, {20,30,1}}},
  "Choose planet", 
  "planet: ", "Choose the planet to calculate an press OK", 0,5 );
  IF ch THEN EXPR(nameplanet(ch)+"()"); END;
END;
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Dynamically call a function - salvomic - 06-20-2015, 03:47 PM
RE: Dynamically call a function - salvomic - 06-20-2015, 05:01 PM
RE: Dynamically call a function - eried - 06-20-2015, 05:43 PM
RE: Dynamically call a function - salvomic - 06-20-2015, 05:56 PM
RE: Dynamically call a function - debrouxl - 06-21-2015, 07:23 AM
RE: Dynamically call a function - salvomic - 06-21-2015, 12:55 PM
RE: Dynamically call a function - DrD - 06-21-2015, 08:03 PM
RE: Dynamically call a function - salvomic - 06-22-2015, 07:13 AM
RE: Dynamically call a function - Didier Lachieze - 06-22-2015 08:06 AM
RE: Dynamically call a function - salvomic - 06-22-2015, 12:43 PM



User(s) browsing this thread: 1 Guest(s)