TI-89 HomeGames ArchiveTitanium GamesGames How ToProgramsFAQForumTI-89 WikiLinks

couple of questions

 
Post new topic   Reply to topic    Your TI-89 Resource Forum Index -> BASIC Programming
Author Message
rrossorr



Joined: 09 Feb 2007
Posts: 3

PostPosted: March 16, 2007 1:22 PM    Post subject: couple of questions Reply with quote

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
View user's profile Send private message
mellamokb



Joined: 10 May 2007
Posts: 124

PostPosted: May 17, 2007 10:52 PM    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:    View previous topic : View next topic  
Post new topic   Reply to topic    Your TI-89 Resource Forum Index -> BASIC Programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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

Contact Us | Privacy Policy | Disclaimer | Trademarks

Copyright ©2006 All rights reserved.


Free Greeting Cards | Girly Myspace Layouts | Myspace Unblocker |