| Author |
Message |
rrossorr
Joined: 09 Feb 2007 Posts: 3
|
Posted: March 16, 2007 1:22 PM Post subject: couple of questions |
|
|
hi,
I've been getting into programming my TI-89 to help ease my engineering calculations.
I have a couple questions:
(1). How do you make a function that has an optional parameter? For example, when you use to differentiate function, your parameters are: expression,variable[,order]
and you can either enter d(x^2,x) and it will give you the first derivative, or you can enter d(x^2,x,2) and it will give you the 2nd derivative.
(2). How can I make a custom hotkey? As an engineer there is a certain mathmatical calculations I have to make a LOT, and it would be so much easier if there was just a single key to achieve it (kind of like my own custom operation sign). Is this possible? |
|
| Back to top |
|
 |
mellamokb
Joined: 10 May 2007 Posts: 124
|
Posted: May 17, 2007 10:52 PM Post subject: |
|
|
Hi rrossorr,
(1) I don't believe that functions can take optional parameters. You can simulate optional parameters by using a certain value that your function will ignore, like -1. For instance, here is a function that returns the area of a square or rectangle; the second parameter is "optional" (signified by -1). If only one parameter is provided, that is assumed to be the side length of a square; the second parameter is the width of a rectangle:
| Code: |
area(l,w)
Func
If w<0 Then
Return l^2
Else
Return l*w
EndIf
EndFunc
|
(2) There are six custom hotkey programs preprogrammed into the TI-89. Create new programs of the form kbdprgm#, where # is 1-6. Then you can run that program simply by pressing [diamond]+[#]. For instance, if you created a program kbdprgm3 to perform a complicated operation and store the result in "y", you can simply press [diamond]+[3] to run the program, and then type "y" in the home screen to see the result.
Hope this helps!
~ mellamokb |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|
Saphic 1.5 // Theme created by Sopel
|
|