Ok. So I have a main program, CDWNMNGR, with three subprograms - MONTH, DAYFWEEK, and UNINUM. Can I, by editing CDWNMNGR's headers, make DoorsCS unArchive the three subprograms every time I click on CDWNMNGR?

If so, How?
I don't know if it's possible to make them unarchive, but I would suggest combining them, as archiving and unarchiving are obnoxiously slow.
Is this in ASM? If so, I dunno. If it's in BASIC then: http://dcs.cemetech.net/index.php?title=BASIC_Header
Will_W wrote:
I don't know if it's possible to make them unarchive, but I would suggest combining them, as archiving and unarchiving are obnoxiously slow.


I would do that, but UNINUM is called so often, in nonpatterned ways, that if I combined them, CDWNMNGR would be larger than the entire amount of RAM.

KeithJohansen wrote:
Is this in ASM? If so, I dunno. If it's in BASIC then: http://dcs.cemetech.net/index.php?title=BASIC_Header


That doesn't help, I tried those, it doesn't work for me
if combined they don't fit into your ram, how do you have them all unarchived at the same time anyway?
Combining them like this shouldn't take too much size. Put them in order of most often to least often called. And use numbers other than 1,2, and 3 if you actually do it.

Code:
If Ans(1)=1:Then
:firstsubprogram
:Else:If Ans(1)=2:Then
:secondsubprogram
:Else:If Ans(1)=3:Then
:thirdsubprogram
:Else
:mainprogram
:End:End:End:Return

I think I fixed it this time.[/code]
Will_W wrote:
if combined they don't fit into your ram, how do you have them all unarchived at the same time anyway?
Combining them like this shouldn't take too much size. Put them in order of most often to least often called. And use numbers other than 1,2, and 3 if you actually do it.

Code:
If Ans(1)=1:Then
:firstsubprogram
:Else:If Ans(1)=2:Then
:secondsubprogram
:Else:If Ans(1)=3:Then
:thirdsubprogram
:End:End
:mainprogram


I mean I have them like this:


Code:
header
code
prgmUNINUM
Ans>blah
code
prgmMONTH
Ans>blah
code
prgmUNIUM
Ans>blah
prgmDAYFWEEK
Ans>blah
code
prgmUNINUM
Ans>blah
code
code
code
prgmUNINUM
Ans>blah


As you see, UNINUM is used a lot.
So are DAYFWEEK and MONTH, but UNINUM is used most.
Will_W wrote:
if combined they don't fit into your ram, how do you have them all unarchived at the same time anyway?
Combining them like this shouldn't take too much size. Put them in order of most often to least often called. And use numbers other than 1,2, and 3 if you actually do it.

Code:
If Ans(1)=1:Then
:firstsubprogram
:Else:If Ans(1)=2:Then
:secondsubprogram
:Else:If Ans(1)=3:Then
:thirdsubprogram
:Else
:mainprogram
:End:End:End:Return

I think I fixed it this time.


Honestly that is an ugly and horrible solution. I literally cringed when I saw that. The way Xeno has it currently is correct.
Kllrnohj wrote:
Will_W wrote:
if combined they don't fit into your ram, how do you have them all unarchived at the same time anyway?
Combining them like this shouldn't take too much size. Put them in order of most often to least often called. And use numbers other than 1,2, and 3 if you actually do it.

Code:
If Ans(1)=1:Then
:firstsubprogram
:Else:If Ans(1)=2:Then
:secondsubprogram
:Else:If Ans(1)=3:Then
:thirdsubprogram
:Else
:mainprogram
:End:End:End:Return

I think I fixed it this time.


Honestly that is an ugly and horrible solution. I literally cringed when I saw that. The way Xeno has it currently is correct.


Did Kllrnohj just compliment me?
What xeno just posted isn't what I'm talking about
I'm talking about calling the subroutines with 2:CDWNMNGR (if you give it a shorter name it this solution works better) instead of having 3 seperate subprograms.
Xeno_Cre8or wrote:
Did Kllrnohj just compliment me?


That's what happens when you do things correctly.

Will_W wrote:
What xeno just posted isn't what I'm talking about
I'm talking about calling the subroutines with 2:CDWNMNGR (if you give it a shorter name it this solution works better) instead of having 3 seperate subprograms.


I know what you meant. Just because Xeno is an idiot and didn't grasp it doesn't mean I didn't (sorry Xeno, had to balance it out Wink ).
I suppose that might not be the best solution for such a large program, although it works well in small programs where consolidation is more important than the loss in size and speed.
in case anyone wants to know, MONTH takes input in the form of a string, stretches it to 16 characters by adding spaces at the end, and uses it as the header of a menu (actually 2 menus connected by more.../...back) with the months as elements. Each month choice spits out (in the Ans variable) the number of the month

DAYFWEEK takes input in the form of a string, stretches it to 16 characters by adding spaces at the end, and uses it as the header of a menu with the days of the week as elements. Each month choice spits out (in the Ans variable) the number of the day of the week

UNINUM takes input in the form of either a 3-element or 1-element list. If it was 3-elements, it interprets it as a human-readable date in {year, month, day} format and twists it into a 1-number date (January 1, 2009 --> 1, February 1, 2009 --> 32, etc)
if the input is a 1-element list, it does the reverse.


but that is not my question. How do I get DCS to unarchive them when I open CDWNMNGR (CountDoWN MaNaGeR)? I probably will have to sacrifice my 16x16 icon, but I'm fine with that.

Kllrnohj wrote:
Xeno_Cre8or wrote:
Did Kllrnohj just compliment me?


That's what happens when you do things correctly.


I mean, you complimenting anyone, let alone me?
have you tried storing Dates as integers? Year + Month*10^5 + Day*10^7 or something similar.
Will_W wrote:
have you tried storing Dates as integers? Year + Month*10^5 + Day*10^7 or something similar.


I store dates like that (Y+10000M+1000000D), but in order to subtract dates (ie for a COUNTDOWN) I need them as integers like my UniNums
maybe it isn't working because you are out of RAM?
You tried this right?

Code:
::DCS
:"16-char_hex_icon
::A
:MONTH
:DAYFWEEK
:UNINUM
::
:Program code

If you run Uninum a whole whole lot, it might be better to think of a shorter name for it, just to save some memory.
Will_W wrote:
maybe it isn't working because you are out of RAM?
You tried this right?

Code:
::DCS
:"16-char_hex_icon
::A
:MONTH
:DAYFWEEK
:UNINUM
::
:Program code

If you run Uninum a whole whole lot, it might be better to think of a shorter name for it, just to save some memory.


Its not a RAM issue. It works fine. I just want to protect the subprogs from RAM clears by keeping them archived unless they're being run.
you protect them from clears by making a group. Also use groups so you can revert to an older version if you break something.
Will_W wrote:
you protect them from clears by making a group. Also use groups so you can revert to an older version if you break something.


But you can't send a group to a calc using TI-Connect, and I want as many people as possible to protect it. I can't protect it for Mirage users, but I might be able to for DCS users.
you could suggest it in the readme and suggest it in the program.
As the examples above show, you can specify programs to unarchive and then rearchive in the DCS header, but you can't select which one(s) are in RAM at any given time. Doors CS will unarchive them all, run the program, and then rearchive them all. There are, however, ASM programs/libraries you could use to manually unarchive and rearchive the subprograms.
  
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 2
» 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