Re: System.ini Loading/Writing

From: David Cole (
Date: 06/12/02


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;
  FILE *SystemFile;
  int Number = 0;
  char Data[24], Line[MAX_INPUT_LENGTH+1];

  if (!(SystemFile = fopen("System/System.ini", "r"))) {
      mudlog("System Error: Couldn't open system.ini", NRM, LVL_GOD, TRUE);

  CREATE(System, struct SystemData, 1);

  while (fgetline(SystemFile, Line)) {
    tag_argument(Line, Data);
    Number = atoi(Line);

    if (!strcmp(Data, "LevelForger           : "))
      System->LevelForger = Number

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:

  struct SystemData *System;

  sprintf(BufOne, "LevelForger           : %d\n", System->LevelForger);
  send_to_char(BufOne, ch);

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?


   | FAQ: |
   | Archives: |
   | Newbie List:   |

This archive was generated by hypermail 2b30 : 06/25/03 PDT