Post Reply 
commands to change settings modes for HOME and CAS but by software?
04-06-2017, 01:57 PM
Post: #3
RE: commands to change settings modes for HOME and CAS but by software?
You can save your settings by simply creating a list containing the various values of each setting. For example,

HVars("MySettings"):={ Language, HAngle, HFormat, HDigits };

will save the language, angle, number format, and digit settings. Then you can restore them with:

LOCAL mysetttings:=HVars("MySettings");
Language:=mysettings(1);
HAngle:=mysettings(2);
HFormat:=mysettings(3);
HDigits:=mysettings(4);

As for programs that would allow users to use more descriptive names for settings, you can shorten your program considerably using a fixed list. For example,

Code:
AngleNames:={"Radians", "Degrees", "Gradians"};
export SetAngle(a)
begin
  local n:=pos(AngleNames,a);
  HAngle:=min(0,n-1); // will default to radians if no match
end;

export GetAngle()
begin
  return(AngleNames(HAngle + 1));
end;

You can also use just "RDG" along with instring() for something shorter:

Code:
export SetAngle(a)
begin
  HAngle:=min(0,instring("RDG",a)-1);
end;

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: commands to change settings modes for HOME and CAS but by software? - Han - 04-06-2017 01:57 PM



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