Texas Instruments TI89TITANIUM User Manual - Page 807
Define, DelFold, creates the folder - games
UPC - 033317191833
View all Texas Instruments TI89TITANIUM manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 807 highlights
Define CATALOG Define funcName(arg1Name, arg2Name, ...) = expression Creates funcName as a user-defined function. You then can use funcName(), just as you use built-in functions. The function evaluates expression using the supplied arguments and returns the result. Define g(x,y)=2xì 3y ¸ g(1,2) ¸ 1! a:2! b:g(a,b) ¸ Done ë4 ë4 Define h(x)=when(xy Then :Return x:Else:Return y:EndIf :EndFunc ¸ Done Is identical to the previous form of Define, g(3,ë 7) ¸ 3 except that in this form, the user-defined function funcName() can execute a block of multiple statements. block can be either a single statement or a series of statements separated with the ":" character. block also can include expressions and instructions (such as If, Then, Else, and For). This allows the function funcName() to use the Return instruction to return a specific result. Note: It is usually easier to author and edit this form of Function in the program editor rather than on the entry line. Define progName(arg1Name, arg2Name, ...) = Prgm block EndPrgm Creates progName as a program or subprogram, but cannot return a result using Return. Can execute a block of multiple statements. block can be either a single statement or a series of statements separated with the ":" character. block also can include expressions and instructions (such as If, Then, Else, and For) without restrictions. Define listinpt()=prgm:Local n,i,str1,num:InputStr "Enter name of list",str1:Input "No. of elements",n:For i,1,n,1:Input "element "&string(i),num: num! #str1[i]:EndFor:EndPrgm ¸ Done listinpt() ¸ Enter name of list Note: It is usually easier to author and edit a program block in the Program Editor rather than on the entry line. DelFold CATALOG DelFold folderName1[, folderName2] [, folderName3] ... NewFold games ¸ Done Deletes user-defined folders with the names (creates the folder games) folderName1, folderName2, etc. An error message is DelFold games ¸ Done displayed if the folders contain any variables. (deletes the folder games) Note: You cannot delete the main folder. Appendix A: Functions and Instructions 807