HP Forums
commands to change settings modes for HOME and CAS but by software? - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: commands to change settings modes for HOME and CAS but by software? (/thread-3654.html)



commands to change settings modes for HOME and CAS but by software? - compsystems - 04-15-2015 11:53 PM

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


RE: commands to change settings modes for HOME and CAS but by software? - AngryNapkin - 04-06-2017 11:38 AM

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?


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

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;



RE: commands to change settings modes for HOME and CAS but by software? - Carlos295pz - 04-06-2017 02:26 PM

(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]


RE: commands to change settings modes for HOME and CAS but by software? - AngryNapkin - 04-07-2017 03:11 AM

Thanks


RE: commands to change settings modes for HOME and CAS but by software? - AngryNapkin - 04-09-2017 01:34 PM

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?


RE: commands to change settings modes for HOME and CAS but by software? - Han - 04-10-2017 04:23 PM

(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?


RE: commands to change settings modes for HOME and CAS but by software? - AngryNapkin - 04-15-2017 03:09 PM

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.