String List
Displaying 1-19 of 19 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
gannon

I uploaded a file into utilities(I didn't know where it would go)
I made some fuctions to handle a indexed list.
I made this file because I ofen put my structs within strings so I can pass them and put structs within structs.
This is just a beta but try it out.
Now you can have lists of strings (or ints easy to convert)
any comment?

Posted on 2004-05-19 19:51:36

gannon

forgot to put the helper getElement(string source,int index)

it is just getToken(source, list_delimiter,index)

I will put it in the next version

Posted on 2004-05-19 20:21:16

mcgrue

I shall put in a libraries section soon.

Also, I do something like this in parts of the (unreleased) Sully battlesystem code... except I use a comma as the delimiter, making everything into (basically) a csv.

But yeah, it's a handy thing to do to get some limited dynamically-sized list action goin'.

Posted on 2004-05-22 16:07:36

gannon

thanks for the response.

being done for the next version
getElementAt
removeElement removes element at last accessed element
addElement and getElement that transverse the list starting at the last accessed element
addAt can add to indexes beyond what is already filled in by putting in "NULL" elements
add/remove from beginning/end to ease of acting like a stack or queue

Posted on 2004-05-22 23:42:43

mcgrue

I would suggest adding some loading-from-file capabilities, and saving-to-file as well. That'd be grand if all handled with a single, simple interface.

Posted on 2004-05-22 23:51:23

gannon

loading and saving to file is easy enough with strings though so putting in a interface for the lists seems pointless

why where you thinking it needed the loading from file?

Posted on 2004-05-23 00:06:48

mcgrue

Persistance is always good. However, you're right... since (as long as there aren't newlines in there) it'd be a single line string going into the save and coming out of the save, that'd be next to a negligable task for anyone integrating this into a savegame system.

Posted on 2004-05-23 00:17:06

gannon

in what format is the strings stored? I thought you could put newlines into strings into files just fine (as long as you read string and not read line)

Posted on 2004-05-23 00:35:36

mcgrue

Perhaps. I only ever read line because I'm lazy. ;)

Posted on 2004-05-23 00:53:34

gannon

tested it
FileWriteString format would work fine with newlines

finished with the new functions(and some bug fixes :P)
if no one wants any more functions say so and I will post it :)

Posted on 2004-05-23 01:51:21 (last edited on 2004-05-23 02:07:43)

gannon

uploaded the newest version :)

Posted on 2004-05-25 18:48:43

rpgking

Great, this should be very useful, seeing as how it has queue/stack-type behavior in some of the functions.

EDIT: I noticed there is a 1 at the end of your VC file. Might wanna fix that.

Posted on 2004-05-25 19:31:54 (last edited on 2004-05-25 20:22:44)

gannon

um there seems to be a problem with the file uploading. I tried uploading it again (mine doesn't have the 1, I did take out some spaces at the end) and it added the one after it does anyone know what is going on?

Posted on 2004-05-25 22:32:15

Overkill

You can't overwrite files. That's the simplest explanation

Posted on 2004-05-26 00:53:51

gannon

I would love to do that but I know you can't and when I upload the newest version it has a one at the end when there is no one there in the file on my computer.
You can see this for yourself (the 1) at the end of my newer files.
(ps. a way of deleting files would be great :P)

edit: I gave the files different names so that souldn't be the problem.

Posted on 2004-05-26 00:58:36 (last edited on 2004-05-26 01:01:15)

rpgking

If you upload it as a zip file, that should take care of this problem for the time being.

Posted on 2004-05-26 01:25:49

gannon

thanks I put it in a zip and it works (no 1 after it).
I wonder what went wrong?

Posted on 2004-05-26 01:40:28

sabernet

Tarkuss Bug;)

Posted on 2004-05-27 22:31:45

blues_zodiakos

Noooooooooo!

Posted on 2004-05-28 21:05:35


Displaying 1-19 of 19 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.