10-15-2015, 06:16 PM

Too bad CONVERT doesn't support variables for arguments. Anyone have a code for a conversion utility?

Update 26 Oct 2015:

My first PRIME program and, over the last week, it has evolved to this solution.

Code:

EXPORT C2,C1;

EXPORT TEST()

BEGIN

LOCAL y,lst,a1,a2;

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"};

a1 := "1_"+lst[C1];

a2: = "1_"+lst[C2];

INPUT(y);

y*CONVERT(a2,a1);

END;

Update 26 Oct 2015:

My first PRIME program and, over the last week, it has evolved to this solution.