Re: System.ini Loading/Writing

Date: 06/12/02

The problem you are having is with the scope of System. When a variable
is declared locally, like you have done with System, it only "exists"  
within the function where it is declared. The struct SystemData you have
allocated with the CREATE macro is still there, but the program can't see
it once you exit the function LoadSystemIni since the program no longer  
recognizes the pointer variable. You get the error about System being  
unitialized in do_systeminfo because you have redeclared it locally within
that function, but you have not set it value to anything.

You need to declare the System pointer globally so that you can access it
in the entire program. Move your declaration command:

struct SystemData *System;

into one of the .h header files. db.h may be a good choice. Then make  
sure that .h file is included in any file where you want to use the pointer.
Also don't declare the pointer locally in a function unless you want to  
use the local version instead of the global one.  


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

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