I was talking to Kerm yesterday about a feature that I thought would be cool in DCS-- the ability to view Groups as if they were folders. You could execute programs from them and whatnot (though you would not be able to edit them). I've been meaning to make a program to access groups like this for a long time, but I never got around to it, so i was passing it on to somebody with more experience than I.

Well, I was staying up pretty late last night and I decided to start my crazy idea rolling. I remember wishing that GroupTool could read other variable types instead of just appvars, so I set out with the goal of making a program that could read any var type from a group.

Lists were a pain, let me tell you.

Since I won't have internet, computer, or any other resources for the next two weeks, I decided to write the program on my calc without references, which is how I will have to program for the next few weeks. This program has only just started, it is not done!

What do I have finished? You can read the name of the nth variable from the group Smile That's about it, but I do have code that is already in the program for reading the actual data. The only issue is that I couldn't think of a decent input command to access that routine (I have an idea, now). Here is a screeny:

The program is 240 bytes (with the unused code), so you can see that it is feasible in a small amount of code to do this. I plan to modify the input so that it looks more like this:

Reading the names of the vars:

Code:
"GroupName→Str1
ItemNumber

Extracting the nth variable:

Code:
"GroupName,VarToCopyTo→Str1
ItemNumber   ;0 will return the number of variables in the group

Extracting a variable by name:

Code:
"GroupName,VarToFind,VarToCopyTo

RecallPic:

Code:
"RecallPic GroupName→Str1
Pic#

Read a line from a program or appvar:

Code:
"Line(GroupName,VarName→Str1
Line#   ;0 will return the number of lines in the variable


My hope is that these will be highly useful for making games. I also hope that I actually finish this and have something to present when I come back on the 30th XD (Plus, I hope it is smaller than CopyProg2 because that would be awesome).

EDIT: Here is finally the download and readme:
Download
Readme/Documentation:

Code:
GRPREAD    985 bytes
by Zeda Elnara
================================================================
  GrpRead is a program for BASIC programmers that want to work
with groups in some pretty cool ways. For example, say you have
an RPG that uses all 10 picture variables and it uses tons of
memory just for item names or monster names, or something like
that. If you group them (using the OS menu), GrpRead will let
you recall those pictures directly from the group and read lines
of code from programs in the group. These are just a few
examples of what GrpRead can do, so read on and I hope this
proves useful!
=============/
Installation/
===========/
  Send GRPREAD.8xp to your calculator. You can now use it.
===========/
How to Use/
=========/
  Arguments are passed mostly through strings or numbers. It
will then return data or perform some function.
==========/
Functions/
========/
     /=========================================================\
     |GetName                                                  |
     \=========================================================/
     |  The group variable will have variables in it. If you   |
     |want to figure out the names of the variables, their type|
     |and their size, this is the command to use. This returns |
     |info on the 'nth' variable in the group. It can also be  |
     |used to figure out how many variables are in the group.  |
     \=========================================================/
     Inputs:
        Str1 has the name of the group
        Ans is the nth var name to return, or zero
     Outputs:
        Ans has the name of the variable (with a prefix byte)*
        Theta has the size of the variable's data
       *A prefix byte is used to specify the type of the
        variable. This is either the " and " token or a letter.
        See the text document named "Prefix Bytes.txt" for info.
     Alternate:
        If the input Ans was 0, this instead returns the number
        of variables in the group. If the group doesn't exist,
        0 is returned.
     Errors:
        "." is returned if the nth variable doesn't exist
     Examples:
        Check if group BACKUP exists and how many vars it has:
             :"BACKUP->Str1
             :0
             :Asm(prgmGRPREAD
        Get the name/size/type of the first variable:
             :"BACKUP->Str1
             :1
             :Asm(prgmGRPREAD
     /=========================================================\
     |ExtractVar                                               |
     \=========================================================/
     |  This command allows you to extract a variable from the |
     |group, copying it to some variable in RAM. This also     |
     |allows you to rename the variable and it automatically   |
     |overwrites a preexisting variable (unless you specify not|
     |to overwrite). There are some pretty neat things you can |
     |do with this, especially for games.                      |
     \=========================================================/
     Inputs:
       Ans is a string containing the name of the group, the
       name of the variable to extract, and possibly the new
       name to extract to. The format:
         "<groupname>:<varname>:<newname>"
       The last argument is optional. If you put a "+" before
       the new name, the var will not be ungrouped if it already
       exists.
     Outputs:
       The variable is copied from the group to a var in RAM.
     Errors:
       0 is returned if the group does not exist.
     Examples:
       First, note that the prefix byte for a program is E and
       the prefix for an appvar is U. Now, to extract prgmFOO
       from group BACKUP:
            :"BACKUP:EFOO
            :Asm(prgmGRPREAD
       Now to extract prgmFOO to appvar BAR:
            :"BACKUP:EFOO:UBAR
            :Asm(prgmGRPREAD
       Now to extract it to appvar BAR without overwriting:
            :"BACKUP:EFOO:+UBAR
            :Asm(prgmGRPREAD
       To extract prgmFOO without overwriting it if it exists:
            :"BACKUP:EFOO:+
            :Asm(prgmGRPREAD
     Notes:
       As you can see, you are able to extract to completely
     different variable types. Use this to your advantage, but
     since lists, real numbers, and matrices have a different
     structure from the other variable types, you should not try
     to extract them or extract to them (or you will lose RAM).
     /=========================================================\
     |RecallPic                                                |
     \=========================================================/
     |  This will let you recall pictures directly from the    |
     |group. Not only that, but it gives you four different    |
     |methods of recalling the picture instead of the 1 way    |
     |that the OS provides.                                    |
     \=========================================================/
     Input (syntax 1):
       Ans is a string with the format
         "RecallPic <Pic#><logic><groupname>"
     Input (syntax 2):
       Ans is the picture number (0=Pic1, 1=Pic2,...,9=Pic0)
       Str1 has the format:
         "RecallPic <logic><groupname>"
       (This is useful for maps and monsters and hacked pics)
     Output:
       The picture var is drawn and the screen is updated if the
       picture variable exists.
     Notes:
       The logic tokens are as follows:
            xor
            and
            or    (This is what the OS uses).
       They can be found at [2nd][Math][Right]. If this argument
       is omitted, the picture will simply overwrite the data on
       the screen.
     Examples:
       Recall Pic1 from group BACKUP, overwriting the data on
     the screen:
            :"RecallPic Pic1BACKUP
            :Asm(prgmGRPREAD
       Recall Pic3 from group RPG using XOR logic (syntax 2):
            :"RecallPic  xor RPG->Str1
            :2
            :Asm(prgmGRPREAD
     /=========================================================\
     |LineRead                                                 |
     \=========================================================/
     |  This lets you read a line of code from a program in a  |
     |group. Note that the line doesn't actually need to be    |
     |code. You can store a bunch of names or words line by    |
     |line in a program. Then, using this function, you can    |
     |recall the data as a string in Ans. Enjoy!               |
     \=========================================================/
     Input:
       Str1 is of the form "Line(<groupname>,<varname>"
       Ans is the line number to read (or zero)
     Output:
       Ans is a string containing the name contents of the line.
       If Input Ans was zero, this instead returns the number of
         lines in the variable.
     Errors:
       ".NO DATA" is returned if the line is empty.
     Examples:
       Read the fourth line of prgmRPGDATA from the group RPG:
            :"Line(RPG,RPGDATA->Str1
            :4
            :Asm(prgmGRPREAD
================================================================
Notes:
  When I wrote this program, I was away from my computer,
internet (or electricity, for that matter) for several weeks. I
wrote the program using a combination of hex and a program named
ASMCOMP. It was basically like writing the program in hex the
normal way, but with the advantage of having labels and equates
and whatnot. Therefore, the source is in the form of a program
to be compiled by prgmASMCOMP.
================================================================
History:
7:37 PM 12/30/2012- Wrote the readme and prepared for initial
release. GetName,ExtractVar,RecallPic,LineRead.        985 bytes
It seems to me that there are enough tools in Celtic III for someone to actually make this as a hybrid BASIC program for Doors CS. If one was to give it a folder icon and name it Groups, then it could lead to a group explorer laid out like the DCS desktop. Of course, it would be smaller and faster if integrated into Doors CS, and will definitely be something for me to consider for the planned TI-84+CSE version of Doors CS. Not to take away from the great work you've done here, of course; I'm just spitballing. I hope this progresses well during your hiatus.
I remember attempting this using Celtic 3 a while back, but I never made it look very nice. For now, I have everything prepared for my time away to get to work on this Smile Thanks!
We came into town, so I have internet for a little bit. I don't have my computer, though, so I cannot yet upload this project (we need a program for the Prizm that can connect to the TI-8x calcs and transfer files >.>). Anyways, I have made progress and changed syntax mostly as I mentioned in the first post:

-You can now get a list of the items in the group, as well as the number of items in the group (via the same command). As well, the size of the variable is returned in theta.
-You can now extract a variable from the group and copy it to another variable.
-You can read lines from grouped variables, like lines from a program.
-You can recall pictures to the graph screen from groups. Four methods are accepted ( and , or , xor , overwrite).

I am still working on other ideas, but I will hopefully be back home on the 30th.
KermMartian wrote:
It seems to me that there are enough tools in Celtic III for someone to actually make this as a hybrid BASIC program for Doors CS. If one was to give it a folder icon and name it Groups, then it could lead to a group explorer laid out like the DCS desktop. Of course, it would be smaller and faster if integrated into Doors CS, and will definitely be something for me to consider for the planned TI-84+CSE version of Doors CS. Not to take away from the great work you've done here, of course; I'm just spitballing. I hope this progresses well during your hiatus.


This probably isn't the relevant place to ask such a question, but I'd just like to ask, will the release 84+ CSE stop the development of the 83+/84+ edition of doors cs, or will they be two separate projects?
@ElectronicsGeek: I'm not sure, but you might get KermM's attention better if you post in the DCS topics (he is more likely to check there).

In other news, I can now release the program, now that I am back home Smile I will be editing the first post with a link to the download and the readme shortly.
ElectronicsGeek, one of the Doors CS topics will be the better place, but it may stop it altogether, as short of a few bug-fixes I had about reached where I wanted to be with Doors CS 7.

Xeda, looking forward to that upload and to play with this new tool.
  
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