CONVERT and variables for arguments
10-15-2015, 07:08 PM
Post: #3
 Han Senior Member Posts: 1,882 Joined: Dec 2013
RE: CONVERT and variables for arguments
Code:

EXPORT C2,C1;
EXPORT TEST()
BEGIN
LOCAL y,lst,a1,a2,t;
CHOOSE(C2, "Convert from", "mm","cm","m","km","inches","feet","yards","miles");
CHOOSE(C1, "Convert to",   "mm","cm","m","km","inches","feet","yards","miles");
//    lst := {"mm","cm","m","km","inch","ft","yd","mile"};
lst := { 1_mm, 1_cm, 1_m, 1_km, 1_inch, 1_ft, 1_yd, 1_mile };
a1 := lst[C1];
a2 := lst[C2];
INPUT(
{
{ y, [2] }
}
);
t:="simplify(" + y + "*" + CONVERT(a2,a1) + ")";
CAS(t);
END;

Is this what you meant?

Graph 3D | QPI | SolveSys
 « 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: 2 Guest(s)