Is it possible to write a line of code that archives a certain file? I have a program that has stuff stored into a variable. I want to be able to archive or unarchive it as an option on the menu screen in the program.
It depends on the variable, and if you are using Hybrid basic.
Well, I have the data I want to save in a string
Use the Archive command. 2nd, +, 5.
I don't think there is a way in basic to tell if it is already archived or not.
Oh, so that will also unarchive it to? Or do I have to use unarchive (6) for that?




Wait, c'mon of course you use the unarchive command. (facepalm)
Razz
Yup, unarchive unarchives it, archive archives it. Some variables, such as programs can't be archived/ unarchived inside a program.
You can very well unarchive and archive a program within another program. It's how programs with many subprograms work. There's also a trick with Lists that allows you to check if a list exists, if it does nothing happens. If that list is archived, it unarchives it. If it doesn't exist, the list is created. I lack an accessible ROM for the emulator as well as a calculator to check on the name but it's accessible from the Lists menu.

Just if you try to unarchive an unarchived program, you get an error. Same if you archive and archived program.
Can someone please give me the code for it? like: UnArchive prgmNAME
Sure, of course, but the only problem is that to do this, it must be written not in TI-basic, but the hex representation of assembly. Here are some basic commands to archive and unarchive programs: Original Here

Perhaps the most important one that you want is this:
Toggle Program Mode

Code:
AsmPrgm21F8893E02AE77C9


Place this in a separate program and call it at the beginning and end, and then you will be able to do this. Of course, If you would like to have access to more variables, here are some more things:

Archiving:

Code:
AsmPrgm
EFD74AD604C0
EB4E234623
117884EDB012
EFF142D8
78B7C0
EFD84FC9


Unarchiving:

Code:
AsmPrgm
EFD74AD604C0
EB4E234623
117884EDB0
12EFF142D8
78B7C8         ;Only difference
EFD84FC9


Toggle Archive Status:


Code:
AsmPrgm
EFD74AD604C0
EB4E234623
117884EDB0
12EFF142D8
EFD84FC9


Input: Ans is a string with the name of the variable to archive. The name needs a prefix byte to determine what type of variable it is.

Code:
 and      Real/Complex
A         List
B         Matrix
C         Equation
D         String
[         Program/Protected program
E         Program/Protected program
F         Program/Protected program
G         Picture
H         GDB
U         Appvar
comicIDIOT wrote:
You can very well unarchive and archive a program within another program. It's how programs with many subprograms work. There's also a trick with Lists that allows you to check if a list exists, if it does nothing happens. If that list is archived, it unarchives it. If it doesn't exist, the list is created. I lack an accessible ROM for the emulator as well as a calculator to check on the name but it's accessible from the Lists menu.

Just if you try to unarchive an unarchived program, you get an error. Same if you archive and archived program.


SetUpEditor
STAT, 5
SetUpEditor [list1, list2, ect]
Which calculator are you dealing with? The TI-83 Plus/TI-84 Plus or the TI-84 Plus C Silver Edition? I ask because Doors CS and Doors CSE both offer functions for archiving and unarchiving programs and appvars, as well as running programs directly from the Archive.
Thanks 16aroth6!

Unicorn, as long as you know the state of the variable you can use use Unarchive and Archive tokens before the variable.
KermMartian wrote:
Which calculator are you dealing with? The TI-83 Plus/TI-84 Plus or the TI-84 Plus C Silver Edition? I ask because Doors CS and Doors CSE both offer functions for archiving and unarchiving programs and appvars, as well as running programs directly from the Archive.


I am using a TI 84+ CSE with Doors.
Ok, but I can't unarchive or archive programs in that way? Just variables?
Unicorn wrote:
Ok, but I can't unarchive or archive programs in that way? Just variables?
The Archive and Unarchive tokens cannot archive and unarchive programs.

Quote:
KermMartian wrote:
Which calculator are you dealing with? The TI-83 Plus/TI-84 Plus or the TI-84 Plus C Silver Edition? I ask because Doors CS and Doors CSE both offer functions for archiving and unarchiving programs and appvars, as well as running programs directly from the Archive.


I am using a TI 84+ CSE with Doors.
Doors CSE can Archive and Unarchive programs. Take a look at http://dcs.cemetech.net/index.php?title=Third-Party_BASIC_Libraries_%28Color%29, specifically ArcUnarcVar.
Oh, I like that. So, the code would be like:
det(5)
Input Str0

Right?

I have a program that assigns a cover to files in Doors and that seems like what it does. Very Happy
You need to assign the name of the program to archive or unarchive to Str0 before you call det(5); otherwise, when Doors CSE intercepts det(5), it won't know what program to archive or unarchive. Also make sure you put the code at the beginning of the program that stops people from running the program without Doors CSE.
So, I would need to switch the code around and then add an if command?
:DSC
Input Str0
If Str0=(something)
Then
det(5)
?????
Sort of! The complete code would be more like this:
Code:
::DCS
:"256-char_hex_icon
:If 81>det([[20
:Then
:Disp "Get Doors CSE to run this:","http://dcs.cemetech.net
:Return
:End
:Input Str0
:det(5
At that point, whatever program name you specified in Str0 will be moved from Archive to RAM or RAM to Archive.
Ok! Thank you.
  
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