Post Reply 
CONVERT and variables for arguments
10-15-2015, 06:16 PM (This post was last modified: 10-26-2015 09:35 AM by epp.)
Post: #1
CONVERT and variables for arguments
Too bad CONVERT doesn't support variables for arguments. Anyone have a code for a conversion utility?

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.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
CONVERT and variables for arguments - epp - 10-15-2015 06:16 PM



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