> Its Me Christian wrote: > > > > right now i have got it like > > strcpy(clan[num_of_clans].id, strtok(NULL, "\r\n")); but if i make id and > > int in the struct then it comes up with an error. and if i take the strtok() > > away and manually hardcode a number in there it works. so is there a way > > that strtok can make it return as a integer. > > > > Just a suggestion: > There are several snippets that save/load data from ascii files. > Find one and follow the logic and/or cut out stuff ya don't need and past in > your stuff .. (there are also several clan snippets that does similar if > not the same as what you're trying to do). Just wanted to add that I've taken the Eclipse of Fate clan code by Mehdi Keddache from the ftp site and changed it to save to an ascii file in the same style as Sammy's ascii pfiles. I did this probably about 8 months ago or so; it has one bug with destroying a clan online that I have to fix to make it totally operable. I won't promise that it's the best code, but it works for me. An example of the file it prints out (all clans save to one file, in order): Clan: 1 Name: Illusionists of Arcadia Memb: 1 Powr: 1 AFee: 0 ALvl: 5 Dues: 0 Cash: 0 NRan: 2 0 Apprentice 1 Mystic 1 Arcadia's Chosen 99 End Priv: 0 2 1 2 2 2 3 2 4 2 5 2 6 2 7 2 99 End Desc: This is a test. This is only a test. This should be only construed as a test of the Local Clan System. ~ If there is anyone with an interest in this code, feel free to email me personally and I'll share what I've done. It is written to work with the newest version of ascii pfiles as well. (Sorry, I just like readable files :) ) If enough interest is shown, I can post it to the ftp site as well. Josh Anderson joshua18@home.com -- +---------------------------------------------------------------+ | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html | | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html | +---------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/04/01 PST