Post Reply 
commands to change settings modes for HOME and CAS but by software?
04-15-2015, 11:53 PM (This post was last modified: 04-16-2015 05:32 PM by compsystems.)
Post: #1
commands to change settings modes for HOME and CAS but by software?
Which are the commands to change modes?, for example exact mode to approximate mode and viceversa, and simplifications, none, maximun, and others of HOME-CAS settings etc

I found some to change angle and other settings?

Code:
    export getMode_angle()
    begin
        if AAngle == 1 then
            return( "RADIAN" );
        else
            if AAngle == 2 then
                return( "DEG" );
            else 
              return( "SYS_ANGLE" );
            end;
        end;
    end;
    
    export setMode_angle( angle_mode )
    begin
        if angle_mode == "RADIAN" then
            AAngle := 1
        else
            if angle_mode == "DEG" then
                AAngle := 2
            else 
              AAngle := 0
            end;
        end;
    end;


I am creating a library for configuring modem by strings, which is much more intuitive than by numbers.

if getMode_angle() == "RADIAN" then
...
else
...
end;


setMode_angle( "RADIAN" );

setMode_angle( "DEG" );

Thanks for your reply
Find all posts by this user
Quote this message in a reply
04-06-2017, 11:38 AM
Post: #2
RE: commands to change settings modes for HOME and CAS but by software?
I would like to know this too, have you found anything out?

I want to save the calculators state, so I can change what I need for my program, and then restore it when it completes.


Anyone know how to change calc settings through program?
Find all posts by this user
Quote this message in a reply
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
04-06-2017, 02:26 PM
Post: #4
RE: commands to change settings modes for HOME and CAS but by software?
(04-06-2017 11:38 AM)AngryNapkin Wrote:  I would like to know this too, have you found anything out?

I want to save the calculators state, so I can change what I need for my program, and then restore it when it completes.


Anyone know how to change calc settings through program?

You can modify the variables shown in the Help.


These variables modify the general configuration (Home):

[Image: 33031331674_ab5c5a0b62_b.jpg]


These are used to manipulate Apps:

[Image: 33718487942_a88d0afe1b_b.jpg]

Viga C | TD | FB
Visit this user's website Find all posts by this user
Quote this message in a reply
04-07-2017, 03:11 AM
Post: #5
RE: commands to change settings modes for HOME and CAS but by software?
Thanks
Find all posts by this user
Quote this message in a reply
04-09-2017, 01:34 PM
Post: #6
RE: commands to change settings modes for HOME and CAS but by software?
I would like to know this too, have you found anything out?

I want to save the calculators state, so I can change what I need for my program, and then restore it when it completes.


Anyone know how to change calc settings through program?
Find all posts by this user
Quote this message in a reply
04-10-2017, 04:23 PM
Post: #7
RE: commands to change settings modes for HOME and CAS but by software?
(04-09-2017 01:34 PM)AngryNapkin Wrote:  I would like to know this too, have you found anything out?

I want to save the calculators state, so I can change what I need for my program, and then restore it when it completes.


Anyone know how to change calc settings through program?

Did you read the third and fourth post?

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
04-15-2017, 03:09 PM (This post was last modified: 04-15-2017 03:55 PM by AngryNapkin.)
Post: #8
RE: commands to change settings modes for HOME and CAS but by software?
That is strange, it posted my question twice here. I did read the posts, and I said thanks for the help. Why this is at the end is strange, and was not from me posting the same question.

I will ask further help with this though. I am able to change my angle "HAngle" from the home screen using HAngle:=0;
But when I try this in a program, I get syntax error. Not sure what Is wrong.

Never mind, found I was trying to change it outside the function.
Find all posts by this user
Quote this message in a reply
Post Reply 




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