TI-89 HomeGames ArchiveTitanium GamesGames How ToProgramsFAQForumTI-89 WikiLinks

My TI89 just trashed all my program files! HELP! #2

 
Post new topic   Reply to topic    Your TI-89 Resource Forum Index -> General Support
Author Message
pronatalist



Joined: 04 Sep 2007
Posts: 5

PostPosted: September 8, 2007 9:16 AM    Post subject: My TI89 just trashed all my program files! HELP! #2 Reply with quote

Reply to mellamokb:

Reply and Quote buttons still don't work, so hence I have to start a New Topic. So I choose a similar title, to try to "link" them in some understandable fashion.

Didn't I say, that I had already archived, hopefully All my important files, to flash memory? That is supposed to survive a dead battery situation, an important reason for cluttering my calculator with duplicate backup files, while more experimenting with the RAM copies of what I am currently working on.

All gone. And I might have backed-up to computer, were I not having computer issues already. When I feel "inspired" to whip up some sample mock-up dialog or screen of what I imagine, the last thing I want to do, is to take up scarce time I don't have already, doing complicated "back-up" chores. Too bad the calculator doesn't have a removable memory card slot.

UPDATE:

Well I went and bought a TI89 Titanium. Yeah, maybe I should boycott TI for trashing my files, but I seem to be too "addicted" should we say, to wanting to program, especially in a program environment I think I am really beginning to understand. Now I can program again, without disturbing my old calculator which I still hope to explore any file recovery options. Like I suspected, the TI89 Titanium isn't that much better. What do you know, they "stole" my "Calendar" file title, so now I am rewriting to call it Cal. And now with a "clock" in the calculator, I have to make my Calendar(Year,Month,Date) more like Cal({}) to make specifying the month to display, "optional" so that the Clock can set the Date. I am rewriting for compatibility with both the old TI89 and TI89T.

Isn't there any way, to make the number of calling parameters variable, as I see with many Catalog built-in functions on the TI89? So I could then do Cal(), or Cal(2007,9) or Cal (2007,9,8), and have them all be accepted? The null set single parameter approach, looks really tacky. I had added a 2-digit Year feature, not that I ever like 2-digit years, but merely because Calendar(7,9,8) didn't take up 2 separate scrolling rows on the Home screen, because Done wouldn't fit on the same line. Of course if I call it Cal now, it probably doesn't even matter now? (If Year is less than 100 then 2000 + Year is assigned to Year.)

NEW PROBLEM:

I decided that some of my old program styling, really wasn't working so well, come to think of it. Why should I waste valuable screen space real estate, putting a Month, Year, and View menus into the Month view Dialog? Could maybe I move those controls outside, to a Graphic screen Toolbar? Just press ESC for more options, and Enter for the standard default-more-stuff, like cycling through Holidays listed at the bottom? A Dialog can have up to 11 rows of text but a Month Calendar technically only needs but 6. Add in my Month Comment, and a Sunrise/Sunset auto-calculation, and I still have at least 3 rows left-over for displaying Date Comments and Reminders and Holidays.

Why not just use the Calendar that comes with my TI89T? Good question. Partly because I didn't program it, very limited features, and it only implements but 2 of the 9 Holiday calculation modes that I had previous programmed and had actually tested and working. I do like the date square scolling and the Holiday name appearing on the bottom status line, and wish I could do more of that myself. Any way for my program to display to the very bottom status line?

THE PROBLEM:

Now I find that I seem to lack any way to create Toolbar menus dynamically, according to how the program wants to form them. The problem is that I have a couple of submenus, that grow in length, that I can't predetermine as a programmer. Of course I can variably assign what appears in each Menu Item, but I can't seem to vary the number of Items, after the fact, under program control. Do I really have to adopt some complicated Popup menu extension, like in those Study Cards or whatever on the TI89T? I prefer not to use Popups, because they too much obscure the Toolbar Menu, which I can "trick" into staying behind the Popup, by using CUSTOM during those instances. And doing a proper Menu Title on a Popup, doesn't really work quite right. I think I will just make the first choice in any such Toolbar "extension" Popups, to be the ALL CAPS Title. But then the user can select it, which what can it really do, but the same as pressing ESC? Popups also can't select a default choice, unless I want it to not be program-disguinguable from an ESC press. I found by setting Var to 0, I can detect a ESC press, because then Var still = 0 afterwards. Popups also don't allow for F1...F7 or left or right scroll buttons to be used, as the Toolbar does. And I have to add a complicated drop-shadow and perhaps fake "Title" effects to Popups, since I can predict where the Popup will appear, and so I can pre-draw behind it on the graphics screen. I can't do that, and so I don't have to, with the Toolbar.

Isn't there any way, that I can convert a program-controlled text string, into program commands? Expr(String) seems way too limited for what I want to do, put an entire Toolbar into the String, and Exec() seems to only be for Assembly stuff, great for Peek(Memory) later I hope, but only to get me into trouble for now until I can learn what to do with Exec(). The command I am looking for, seems to be lacking. I need a ProgCode(String) or something like that. Any suggestions? That would allow me to vary the number of "Items" in the Toolbar submenus, and program a variable Toolbar hander subroutine or whatever for my program. Hopefully the setup "lag" time for the Toolbar to appear, would be minor. Hopefully my Item lists won't grow too long. I know Popups can do variable-sized sets for its menu list, but Popups aren't quite the effect I wanted.

I had also hoped for Dialogs with a "varible" number of Text rows, without having to do an If, ElseIf, EndIf construct with 11 alternate Dialog choices. Of course, maybe that's the way to do it, putting each row into a separate list element, with a properly short 1-character variable name?

VAL(String) function

I thought Expr(String) would convert text encoded "numbers" into numbers, but when I tried it before, I seem to get random Syntax errors when reading my text-based Holiday codes. Simply substituting Val(String) for every Expr(String) simply fixed it. So I used an old algorithm I knew of, reading the Ord(String) of each character, subtracting 48, and then accumulating the result while multiplying the old accumulated result by 10 for each pass of the For loop. And put it into an external Val(String) function. Maybe that's one reason why my Calendar program took a painful 4 or 5 minutes to process but only 90-some holidays? (Only but a second or two, per holiday, according to the "progress thermometer" I had to add, to be able to endure the wait.) Why can't I use Expr("09") to do this process for me?

Any "corners" I can cut, to shorten my program code? I seem to be having quite a time with "bloatware." I would like to get as many features, without having such long run-on program coding. Perhaps higher levels of data abstraction would help, but that makes programs harder to debug. I have been trying to export some of my program data, almost into user-definable (through the program) global text strings.
Back to top
View user's profile Send private message Send e-mail
mellamokb



Joined: 10 May 2007
Posts: 124

PostPosted: September 8, 2007 5:47 PM    Post subject: Reply with quote

Hi pronatalist,

I'm probably not much help, but here are my answers to your questions (there really is nobody else active on this forum....)

1) TI does NOT support assembly programming on their calculators! You're at your own risk. So "boycotting" TI because one of your own programs crashed your own calculator and cleared the FLASH ROM is really pointless...

2) TI does not have variable parameter capability built-in for BASIC programs, but you're welcome to write your own library for this. I might even use it Smile.

3) TI-89 Titanium was not created to have additional features. It was created to be faster and have more memory (and it is both of these, I own one myself and can attest to this).

4) You cannot display to the very bottom status line because that is reserved for the OS. However, ASM can use the whole screen, and your welcome to write your own library so that BASIC programs can use the whole screen, too.

5) You can indeed run any program code using Expr(). You are simply using the wrong syntax. For instance, I used the following to create a custom menu bar with two items (could be programmatically determined for any number of items):

Code:

Expr("Custom: Title ""m"": Item ""h"": Item ""n"": EndCustm")


Notice two things: everything quoted must have double quotes when already in quotes; colons are used to separate multiple instructions (much like the colons at the beginnings of lines in the program editor).

6) I typed Expr("09") on my calculator and got the number 9. What did you get?

7) Expr() is very powerful, you just have to use it properly. It can be used to run any code, store variables, and create menubars / toolbars / dialogs with variable length menus / dropdowns. It is however less efficient than typing the code directly because all programs are compiled before running, and Expr() causes run-time code execution, which is always slower than pre-compiled code.

Cool The calculator is too small and slow to justify abstract data types just for a "cleaner" program. Computer programmers take advantage of the extreme speed of most modern computers to cut corners in writing code and to make code look "neater" and "well-written". If nobody is going to read the source code except you, you will have much better luck writing the program for speed than for "neatness".

You might, however, try splitting a single program into multiple programs and use individual prorgams as "subroutines" as opposed to using Goto's and Label's. This may increase speed slightly and will make code easier to debug since there is no "jump to line number" feature in TI-89. You might also try writing your BASIC code on a computer where you can see a lot more code at once and type a lot faster. Then you can test with a Virtual TI before sending it to your calculator--and BASIC programs have the added advantage of not being able to disrupt the OS or FLASH ROM Smile.

Hope this helps you in some way. PLEASE just ask your questions, short, quick, and to the point. Don't try to tell me all about your knowledge of programming, I'm a seasoned programmer.

~ 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 -> General Support 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 |