Post Reply 
2021: user vars menu
04-28-2021, 02:54 AM (This post was last modified: 05-09-2021 10:09 PM by compsystems.)
Post: #1
2021: user vars menu
Hello

My first HPcalc was a hp48gx and I used the [Var] key to access the variables in the HOME directory, this key is merged into my memory.

Now when I press the [VARS] key on the hp-prime, it doesn't show a menu for user functions, only vars functions (export) and CAS user variables and functions. I think there has to be a menu for this, my proposal is that when pressing the [HOME] menu, it is shown as option 8: the user variables, see attached image.

Similarly, in the [TOOLS] menu it shows only the functions variables of the HOME mode, the CAS menu must have as option 8: a menu to access the user variables.

[Image: vars_hp_prime_image00.png]

Now if the program contains global variables, if the variables menu appears, but the name of the function cannot be accessed, it is necessary to press the [Tools] button, thne [User], the idea is that everything is unified, both the program variables and the functions of a file in a single menu, because otherwise it causes confusion.

PHP Code:
#cas
triangleArea_cas():=
begin
    purge
(const_tarea_tbase_theight_tanswer_t);
    print; PRINT()
    
const_t := '1/2';
    
area_t := const_t*'(base_t * height_t)';
    print( 
'area'=area_t ); 
    print( 
"Please enter the BASE of the triangle " ); wait;
    
base_t := 3; print( ">" base_t ); 
    print( 
"Please enter the HEIGHT of the triangle " ); wait;
    
height_t := 4; print( ">" height_t ); 
    
answer_t := eval(area_t); 
    print( 
"The AREA of the triangle is: " answer_t );
    return { 
'base'=base_t'height'=height_t'area'=answer_t };
end

PHP Code:
export area_tbase_theight_tanswer_t;
//export area_t, base_t:=3, height_t:=4, answer_t;
const const_t:= '1/2';
export TriangleArea_home()
begin
    
// local area_t, base_t, height_t, answer_t;
    
print();
    
area_t := const_t*'base_t * height_t';
    
print2d'area'=area_t ); // FIRMWARE 2021
    
print( "Please enter the BASE of the triangle " ); wait;
    
inputbase_t ); print( ">" base_t ); 
    print( 
"Please enter the HEIGHT of the triangle " ); wait;
    
inputheight_t ); print( ">" height_t ); 
    
answer_t := eval(area_t); 
    print( 
"The AREA of the triangle is: " answer_t );
    return { 
"base="+base_t"height="+height_t"area="+answer_t };
end

[Image: vars_hp_prime_image01.png]
Find all posts by this user
Quote this message in a reply
04-28-2021, 05:53 AM
Post: #2
RE: user vars menu
Hello,

I started with a 48sx also, so I understand you...
Unfortunately, Prime is a derivative (in some ways) of the 38G... which had a different paradigm.

One of the thing that prime does well, in my opinion, is to allow users to USE things in a "unified way", while still showing to the slightly more advanced user that they are different concepts, coming from different parts of the system and that overuse of them could be problematic.

I think that this is VERY important as this is a critical concept in programming. "object locality" you could call it.

Without going to the extreme of some of the modern programming languages where you end up typing tons of lines of the form: framework.subFframework.objectCollection.objectType.someOtherCrap.theFuncitonYou​ActuallyWant(Do, It, Again, With, Parameters)....

Prime does teach you that things like variables and function do have a place that they belong to, and how to deal with collision.

Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
Post Reply 




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