Post new question
Question
Reply
 
Student
Posts: 1
Member Since: ‎08-11-2016
Message 1 of 2 (1,246 Views)
Accepted Solution

HP Prime Cas.Mode in Program functions

Product Name: HP PRIME

Hello community, I'm learning some of HP Prime programming language, but I'm not really associated at this, I would like to know basic structure using Matrix and CAS functions (both in programming mode). I''ll really appreciate some examples with programs using both of this. Tell if I'm unclear. 

Reply
0 Kudos
Accepted Solution

Re: HP Prime Cas.Mode in Program functions

Hello,

 

This is quite a whide domain/field here!

 

First, you need to know that they are 2 programming languages in HP Prime. They are relatively similar, but not exactly, which can be at the same time a plus (only 1 thing to learn) and a minus (subtle differences are not very visible and can cause problems)...

 

Anyhow, to create a new CAS program, go to the program catalog (shift program), and click on New, enter the program name and check the CAS check box.

 

This will create a basic, empty CAS program along the lines of:

#cas

TEST():=

BEGIN

  return 0;

END;

#end

 

TEST is the name of the function (you can have as many as you want in your cas program)

in the parenthesis, you find the arguements. In this case none, but add which ever you want/need as in:

TEST(param1, param2, param3)

 

between the BEGIN and END, you find the core of your program. There you can assign values to variables (using the variable_name:= expression_that_returns_a_value;  syntax. For exampl: a:= 1+2Smiley Wink

 

You will find a lot (but not all), of the matrix commands in the Toolbox key/ math/Matrix menu.

you can access (read and write) an element of a matrix by doing var[row,col]

 

The Template menu item (in the main program editor window) should show you what the basic programming constructs look like (looks and tests).

 

This should get you started. Once you have experienced with this, you should be able to come back to this forum and ask more specific questions.

 

Regards,

Cyrille

View solution in context
Highlighted
Teacher
Posts: 104
Member Since: ‎05-30-2013
Message 2 of 2 (1,198 Views)

Re: HP Prime Cas.Mode in Program functions

Hello,

 

This is quite a whide domain/field here!

 

First, you need to know that they are 2 programming languages in HP Prime. They are relatively similar, but not exactly, which can be at the same time a plus (only 1 thing to learn) and a minus (subtle differences are not very visible and can cause problems)...

 

Anyhow, to create a new CAS program, go to the program catalog (shift program), and click on New, enter the program name and check the CAS check box.

 

This will create a basic, empty CAS program along the lines of:

#cas

TEST():=

BEGIN

  return 0;

END;

#end

 

TEST is the name of the function (you can have as many as you want in your cas program)

in the parenthesis, you find the arguements. In this case none, but add which ever you want/need as in:

TEST(param1, param2, param3)

 

between the BEGIN and END, you find the core of your program. There you can assign values to variables (using the variable_name:= expression_that_returns_a_value;  syntax. For exampl: a:= 1+2Smiley Wink

 

You will find a lot (but not all), of the matrix commands in the Toolbox key/ math/Matrix menu.

you can access (read and write) an element of a matrix by doing var[row,col]

 

The Template menu item (in the main program editor window) should show you what the basic programming constructs look like (looks and tests).

 

This should get you started. Once you have experienced with this, you should be able to come back to this forum and ask more specific questions.

 

Regards,

Cyrille

I am an HP Employee
† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation