David Cole wrote: ><SNIP> > >I see, that was dumb of me. >So this returns no errors, and also opens the file and reads from it: > >void LoadSystemIni(void) >{ > struct SystemData *System = NULL; System is local to this function. Its value goes away when you return from it. [snip] >} > >Now that, that is working (and seem to look right?) the only problem I seem >to be having is actually calling the information in a command to view the >data, like below: > >ACMD(do_systeminfo) >{ > struct SystemData *System; > System here is local to THIS function. It isn't initialized here. It'll prolly just segfault when you run it. > sprintf(BufOne, "LevelForger : %d\n", System->LevelForger); > send_to_char(BufOne, ch); ><SNIP> >} > >It complains that I am not initilizing *System, my brain is failing me atm, >how am I going to initilize this without = NULL; so that it isn't blank? > Take out the "struct SystemData *System;" from both functions and make it a global. -me -- +---------------------------------------------------------------+ | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html | | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html | | Newbie List: http://groups.yahoo.com/group/circle-newbies/ | +---------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 06/25/03 PDT