![]() ![]() |
Nov 9 2003, 11:27 PM
Post
#1
|
|
|
Rookie ![]() ![]() ![]() Group: Members Posts: 80 Joined: 7-November 03 Member No.: 1,690 |
I JUST noticed this dataset thing. Read a little in the help files in actool. Got one quick question.
Did datasets replace lists? And do they use the same type of logic appendfile(fileappend? *shrug* i forgot) type stuff use in VB 6? |
|
|
|
Nov 9 2003, 11:34 PM
Post
#2
|
|
![]() Insane Poster ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 360 Joined: 28-April 03 Member No.: 310 |
Datasets can hold more information than lists can.
Ex. Dataset Test Name = String 100 Word = String 100 End The dataset name is "Test" And the two Sets (im trying) inside are Name and Word, each with a max string capacity of 100 characters (i believe) DSLoad - Loads the dataset DSPost - Saves changes DSSave - Saves the dataset DSFirst - Go to first entry and some others... -------------------- Prismatic Shimmer - Level 100+ Life Crossbow
Bounty'Hunter- Level 70+ Melee |
|
|
|
Nov 9 2003, 11:39 PM
Post
#3
|
|
|
Rookie ![]() ![]() ![]() Group: Members Posts: 80 Joined: 7-November 03 Member No.: 1,690 |
yah they already look to be a very powerful tool. I'm havin a hell of a time catchin on myself.
|
|
|
|
Nov 9 2003, 11:46 PM
Post
#4
|
|
![]() Lord of the Forums ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 1,801 Joined: 15-April 03 From: London, Ontario, Canada Member No.: 14 |
They're very powerfull and usefull tools. With filtering and sorting capabilities as well. It does take a bit of time to work your head around them, but once you do you'll wonder how you got along without them!
-Triane -------------------- SQL>SELECT * FROM users WHERE clue > 0;
0 rows returned SQL>_ |
|
|
|
Nov 10 2003, 10:23 PM
Post
#5
|
|
|
Rookie ![]() ![]() ![]() Group: Members Posts: 80 Joined: 7-November 03 Member No.: 1,690 |
JEEBUS I cant for the life of me figure these things out...I'm starting to feel challenged.
|
|
|
|
Nov 10 2003, 10:26 PM
Post
#6
|
|
![]() Lord of the Forums ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 1,801 Joined: 15-April 03 From: London, Ontario, Canada Member No.: 14 |
Hehe -- ask questions! I'm sure most of us will try to help
-Triane -------------------- SQL>SELECT * FROM users WHERE clue > 0;
0 rows returned SQL>_ |
|
|
|
Nov 10 2003, 11:35 PM
Post
#7
|
|
|
Rookie ![]() ![]() ![]() Group: Members Posts: 80 Joined: 7-November 03 Member No.: 1,690 |
I don't ask questions on this topic, in fear of feeling/looking stupid.
|
|
|
|
Nov 10 2003, 11:41 PM
Post
#8
|
|
![]() Lord of the Forums ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 1,801 Joined: 15-April 03 From: London, Ontario, Canada Member No.: 14 |
I don't think you'd get much if any grief for asking questions. We all had to wrap our heads around Datasets at one point or another, I remember the frustration I had trying to figure them out originally, but wow, once I got there it was amazing!
Datasets add so much power to AcTools, you're really cutting yourself off if you choose to avoid them just because you don't want to ask questions. I'll be happy to help if I can, and I'm sure the same applies to the other coders on here. Trust me, the payoff is worth the (small) risk of being embarassed. -Triane -------------------- SQL>SELECT * FROM users WHERE clue > 0;
0 rows returned SQL>_ |
|
|
|
Nov 11 2003, 12:21 AM
Post
#9
|
|||||||||
![]() Insane Poster ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 360 Joined: 28-April 03 Member No.: 310 |
Basically if you avoid datasets your cutting your self off from a list of things such as: BuffBots Combat Assistants Tradeing Bots Anything that requres the storage of data. I will try to explain how to make a dataset and work with it best i can. To make a dataset, load up ACTools and make a new macro. Remove the first two lines:
All we are going to do right now is make the actual dataset. Now, type the following
That is the dataset its self. The difference between a dataset and list is a dataset can hold more information than a string will ever be able to. Now, you can add your information to your dataset by eather one of two ways. Through ACTools, or through the CDS editor that comes with ACTool (its in the actool folder) To add information through ACTools: using the DSAppend command we can add information to the dataset at the position it is at (should be the first entry, seeing as there is no information in it yet) Type the following code into your macro:
The fiest line is make the dataset ready for editing (DSAppend) The next two lines are adding information to a field in that dataset (Example1, and Example2) And the last line (DSPost) is saving the changes. Now, add in the following code under the above:
This will call the procedure, and then save the dataset to your hard drive. Once you have all that typed in start the macro. Once it stops, browse to your C drive and look for a file called "Example.cds" To Open this file, open your ACTool folder and open the CDS editer that is located within. Once open, click File >>> Load >>> C:\ >>> and open Example.cds You should now see two fields "Example1" and "Example2" within the CDSEditor window, And under the fields should be some text. If you can see the text, Congrats, you have just made your first dataset and added information to it! The second way to add information to a dataset is to make the dataset with ACTools, save it without adding any information, load up the CDSEdit program, and add your information through that. Now, working with them. Suppose you have a big dataset with lots of information and you want to find a line of information in that dataset. First, you would load the dataset in using "DSLoad. Once loaded, you can create a procedure to find what your looking for using the DSLocate option (Something along the lines of "DSLocate DatasetNameHere, ThingToFindHere. They can do more than hold text, they can hold numbers, spells, account balances if you have a buffbot, or a monster database if you make a combat assistant. It really doesnt matter what you want to use it for Sorry if this made you more confused than you already are. And if i messed up anywhere in there, please, feel free to correct me. -------------------- Prismatic Shimmer - Level 100+ Life Crossbow
Bounty'Hunter- Level 70+ Melee |
||||||||
|
|
|||||||||
Nov 11 2003, 01:27 AM
Post
#10
|
|
![]() Lord of the Forums ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 1,801 Joined: 15-April 03 From: London, Ontario, Canada Member No.: 14 |
Lol -- okay, time for a brief overview of datasets: (I'd hoped to avoid doing this by just answering specific questions, but rather than leave a part-description, I'll try to cover most of the bases):
Important notes: Datasets store information in MEMORY as fields and records. Dataset fields do NOT have to be of the same type, supported types are Integer, String and Float (or Double, that one always gets me, but it's hardly ever used). Datasets do not have to be saved to disk, or loaded from it, although both are options. This one's important (and IMO is what confuses most people): Datasets perform INTERNAL record tracking! By this, I mean that the Dataset keeps an internal pointer to the current record, you don't HAVE to track this yourself (although you can). When you DSAppend data, the pointer sticks to the last record. You can then move the pointer forward or backward via DSNext and DSPrev. You can also move the pointer all the way to the front of the set with DSFirst or to the end with DSLast. These are the basics of navigating a dataset. Shimmer touched on one of the ways to modify the contents of the set (DSAppend which always adds new data to the end of the set, and moves the pointer to that record), the other method is DSEdit which edits the record at the current position of the pointer. In all cases, you need to use DSPost to "close" the modification and retain your changes. You can also remove the dataset record with DSDelete, which does not use or need DSPost to make final. You can dereference the dataset's size with DSCount, and you can force the pointer to move to a specific record via DSGotoRec. DSRecNo reports the current position of the pointer within the dataset. For global dataset operations, you have DSEmpty (which erases the entire contents of the dataset from memory), DSCopy (which copies the contents of one dataset to another), DSLoad and DSSave (which are file operations for loading and saving the dataset from/to disk). Any dataset that is loaded from disk ignores whatever field it was defined with, and takes on the field definitions of the dataset that was saved to disk. This is also true of the destination set from a DSCopy operation. The last set of important dataset commands are data-manipulation commands. DSFilter allows you to selectively hide records that don't meet the criteria in the filter-declaration. These records are not erased, but for as long as the filter remains in place, they will not be accessible. Applying a filter affects the apparent size of the dataset because the hidden records do not count. It also affects pointer operations. For all intents and purposes, you can think of the dataset as no-longer containing the data that has been filtered out. The important part though, is that if you remove the filter, all of the "missing" records come right back. DSFilter is probably both the most complex AND most powerful feature of dataset operations. The other thing you can do with a dataset is sort it. The only trick to sorting datasets is that you can define several methods for sorting datasets (via DSIndexAdd), but you can only ever have one method applied at a time. You create indexes and name them, and then apply whichever sort you need via DSIndex. I recommend that you use the ACTools help features and README.TXT reference for more detailed information about any of the commands I've mentioned here, and of course, feel free to ask questions here too. It probably seems like a lot all at once, but it's not so bad if you take it in little bites -Triane -------------------- SQL>SELECT * FROM users WHERE clue > 0;
0 rows returned SQL>_ |
|
|
|
Nov 11 2003, 05:17 AM
Post
#11
|
|
|
Rookie ![]() ![]() ![]() Group: Members Posts: 80 Joined: 7-November 03 Member No.: 1,690 |
WOW! thanks guys. Both helped me A TON!
I'm still confused on some things, When I get wake up, and get some time to form some questions, I'll probably have a few |
|
|
|
Jan 3 2004, 07:10 PM
Post
#12
|
|
|
Cool Newbie ![]() ![]() Group: Members Posts: 46 Joined: 31-August 03 Member No.: 1,417 |
Tag
|
|
|
|
![]() ![]() |
| Lo-Fi Version | Time is now: 3rd September 2010 - 07:28 AM |