Post Reply 
Using the CONVERT() function in program
10-30-2019, 12:35 PM
Post: #6
RE: Using the CONVERT() function in program
INPUT can force you to type the unit on the data entered, but this can be annoying and slow
Code:
INPUT({{var,[9]}})

[Image: 48985609017_0e331e3653_o.png]

A more friendly alternative would be to indicate the unit in the label or help.
Code:
  INPUT(var,{},"Long (km):");
  var:=var*1_km

[Image: 48985395031_d5b9458292_o.png]

You can also achieve something more interactive with a selection of the unit
Code:
  LOCAL var,und={"mm","cm","m","km"},un;
  INPUT({{var,[0],{20,20,0}},{un,und,{42,15,0}}},{},"Long:");
  var:=EXPR(var+"_"+und(un))

[Image: 48985586042_b60c31d2d7_o.png]

Viga C | TD | FB
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Using the CONVERT() function in program - Carlos295pz - 10-30-2019 12:35 PM



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