CONVERT and variables for arguments
10-16-2015, 01:14 PM (This post was last modified: 10-17-2015 01:55 PM by epp.)
Post: #7
 epp Junior Member Posts: 23 Joined: Oct 2015
RE: CONVERT and variables for arguments
Here's the final version. I've also done Volume and Weight conversions using this as a template.
Code:
 EXPORT D2,D1; EXPORT Distance() BEGIN     LOCAL x,lst,a1,a2,t;     INPUT({{ x, [2], {45,20,3} }},"","Convert ");     IF string(x,1) == "0" THEN RETURN; END;     CHOOSE(D2, "Units", "mm","cm","m","km","inches","feet","yards","miles");     CHOOSE(D1, "To",    "mm","cm","m","km","inches","feet","yards","miles");     lst := { 1_mm, 1_cm, 1_m, 1_km, 1_inch, 1_ft, 1_yd, 1_mile };     a2 := lst[D2];     a1 := lst[D1];     t := "simplify(" + x + "*" + CONVERT(a2,a1) + ")";     CAS(t); END;
 « Next Oldest | Next Newest »

 Messages In This Thread CONVERT and variables for arguments - epp - 10-15-2015, 06:16 PM RE: CONVERT and variables for arguments - eried - 10-15-2015, 07:05 PM RE: CONVERT and variables for arguments - Han - 10-15-2015, 07:08 PM RE: CONVERT and variables for arguments - epp - 10-15-2015, 07:46 PM RE: CONVERT and variables for arguments - StephenG1CMZ - 10-15-2015, 09:25 PM RE: CONVERT and variables for arguments - Han - 10-15-2015, 09:31 PM RE: CONVERT and variables for arguments - epp - 10-16-2015 01:14 PM RE: CONVERT and variables for arguments - eried - 10-17-2015, 01:40 PM RE: CONVERT and variables for arguments - epp - 10-17-2015, 02:13 PM RE: CONVERT and variables for arguments - StephenG1CMZ - 10-19-2015, 01:18 PM RE: CONVERT and variables for arguments - epp - 10-17-2015, 10:03 PM RE: CONVERT and variables for arguments - Han - 10-18-2015, 01:19 AM RE: CONVERT and variables for arguments - epp - 10-18-2015, 05:52 AM RE: CONVERT and variables for arguments - StephenG1CMZ - 10-21-2015, 09:26 AM RE: CONVERT and variables for arguments - epp - 10-21-2015, 10:14 AM RE: CONVERT and variables for arguments - StephenG1CMZ - 10-21-2015, 11:26 AM RE: CONVERT and variables for arguments - epp - 10-21-2015, 01:14 PM RE: CONVERT and variables for arguments - StephenG1CMZ - 10-21-2015, 01:23 PM RE: CONVERT and variables for arguments - epp - 10-21-2015, 03:06 PM RE: CONVERT and variables for arguments - StephenG1CMZ - 10-21-2015, 03:50 PM RE: CONVERT and variables for arguments - StephenG1CMZ - 10-21-2015, 06:59 PM Conversions Implemented as a Function - epp - 10-22-2015, 11:35 AM RE: CONVERT and variables for arguments - StephenG1CMZ - 10-22-2015, 11:12 PM RE: CONVERT and variables for arguments - epp - 10-24-2015, 09:35 PM RE: CONVERT and variables for arguments - StephenG1CMZ - 10-30-2015, 08:26 AM

User(s) browsing this thread: