Post Reply 
Converting
02-05-2015, 07:06 PM
Post: #25
RE: Converting
(02-05-2015 09:18 AM)Angus Wrote:  I still bewail that there is no way of 'executing' a return-value. If I could send a returned command to the parser(s) many things that slow down work could be solved. Key bindings in RPN could get an RPN feel (plus saving keystrokes) and so on...

Can you not do that with return(30) ? That is, create your program that you wish to use as a key replacement, and instead using return("command"), just add command() to your program and use return(30) -- which is the enter key. Perhaps I am misunderstanding your post.

Separately...

Minor changes to "about 10 keystrokes for unit conversion" code:

In the previous version, escaping from the menus (with user keys enabled) would not produce an underscore. The tiny modification now creates an uderscore with no units should users want... an underscore with no units :-)

Code:
lastunit:={0,0};

KEY KS_Space()
BEGIN
  local list1:={"Length", "Volume"};
  local list2:={{"m","cm","in"},{"m^3","cm^3","in^3"}};
  local c1,c2;
  if lastunit(1) OR lastunit(2) then
    c1:=lastunit(1); c2:=lastunit(2);
    choose(c2,list1(c1),list2(c1));
  else
    c1:=0; c2:=0;
  end;

  if c2==0 then
    repeat
      choose(c1,"Units",list1);
      if c1 then
        choose(c2,list1(c1),list2(c1));
      end;
    until c1==0 OR c2;
    lastunit:={c1,c2};
  end;

  if c2 then return("_"+list2(c1,c2)); else return("_"); end;
END;

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Converting - marcusnicolas1 - 01-24-2015, 03:18 AM
RE: Converting - toml_12953 - 01-24-2015, 06:06 AM
RE: Converting - Miguel Toro - 02-01-2015, 01:15 PM
RE: Converting - Joe Horn - 01-25-2015, 01:12 AM
RE: Converting - toml_12953 - 01-25-2015, 03:57 AM
RE: Converting - rprosperi - 01-25-2015, 04:28 AM
RE: Converting - marcusnicolas1 - 02-01-2015, 02:59 AM
RE: Converting - Joe Horn - 02-01-2015, 06:02 AM
RE: Converting - retoa - 02-03-2015, 09:49 PM
RE: Converting - Offroad - 02-03-2015, 10:24 PM
RE: Converting - retoa - 02-03-2015, 10:48 PM
RE: Converting - Offroad - 02-03-2015, 11:09 PM
RE: Converting - Joe Horn - 02-04-2015, 12:34 AM
RE: Converting - retoa - 02-04-2015, 07:15 AM
RE: Converting - Joe Horn - 02-05-2015, 06:52 AM
RE: Converting - retoa - 02-05-2015, 07:25 AM
RE: Converting - Tim Wessman - 02-03-2015, 11:17 PM
RE: Converting - ndzied1 - 02-03-2015, 11:45 PM
RE: Converting - Offroad - 02-03-2015, 11:54 PM
RE: Converting - ndzied1 - 02-04-2015, 01:45 AM
RE: Converting - ndzied1 - 02-04-2015, 06:56 PM
RE: Converting - retoa - 02-05-2015, 10:41 AM
RE: Converting - Han - 02-04-2015, 07:31 PM
RE: Converting - Claudio L. - 02-06-2015, 04:30 PM
RE: Converting - Angus - 02-05-2015, 09:18 AM
RE: Converting - Han - 02-05-2015 07:06 PM
RE: Converting - ndzied1 - 02-05-2015, 07:13 PM
RE: Converting - Offroad - 02-05-2015, 07:23 PM
RE: Converting - retoa - 02-05-2015, 07:49 PM
RE: Converting - ndzied1 - 02-05-2015, 08:29 PM
RE: Converting - Han - 02-05-2015, 08:57 PM



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