Sorry if this is a stupid question but I saw taht there is a Try/Else/EndTry command for 68k basic and woderd if there is anything simmilar for the Z80 architecture... I just need something to help with archiving, unarchiving and editing of a matrix. I don't want the user to wory about this, or ask him if he knows if a certain matrix already exists or if its archived or not.
I would apreciate any help.
There does not exist a Try command in TI-BASIC for the z80 line of calculators

For most versions, you can perform Archive an Unarchive commands on a matrix whether or not it is already archived. The dim( command will return a zero for matrices that do not exist (or have a dimension of 0). So your program flow could be:


Code:
:UnArchive [A] //ensures [A] is in RAM
:If dim([A]) //only continue if the matrix exists
:Then
// Do your stuff here
:End
NoahK wrote:
For most versions, you can perform Archive an Unarchive commands on a matrix whether or not it is already archived. The dim( command will return a zero for matrices that do not exist (or have a dimension of 0). So your program flow could be:


Code:
:UnArchive [A] //ensures [A] is in RAM
:If dim([A]) //only continue if the matrix exists
:Then
// Do your stuff here
:End

This wouldn't work, since both UnArchive and dim() give ERR: UNDEFINED if the matrix doesn't exist.
Ah darn. My memory must be failing me. Sorry about that.
Why didn't TI add a SetUpEditor command for matrices? Anyway, if you can use lists instead of matrices, then use them as SetUpEditor detects if they exist and create them (while unarchiving them if they exist in archived form).
There's no language primitive that gives you the ability to catch exceptions/errors, unfortunately; you need to anticipate errors. If you're on a monochrome TI-83+/TI-84+,

Now that I think about it, I'm a little surprised I didn't add a function to the TI-BASIC libraries in Doors CS to catch errors thrown and either continue the program at some user-specified label, or (since my memory is that by the time the error is thrown the parser context has already been torn down) relaunch the program jumping to a specific label or with a specific variable set.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
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

 

Advertisement