Hi Sina,
>>      I wrote a class and i want to use an instance of it
>>     as a global variable, I define it in interface part,
>>     and I call its constructor from main form create
>>     event, but whenever I want to use this instance (
>>     global variable) it has become null!!!! what shoud I
>>     do?

You can try using a data breakpoint (ie, a breakpoint that fires whenever 
the variable gets written to.)  Start your app using F7, so it is stopped on 
the first line of the program.  Then press Ctrl-Alt-B to bring up the 
Breakpoints window, right click on it, click "Add"->"Data breakpoint"  In 
the "Address" edit box, type in the name of your global variable, then click 
OK. (It might be a good idea to be specific by qualifying the global with 
the unit it exists in, e.g. you can type "Unit1.Form1" if you want to break 
when the Form1 global in Unit1 is written to.)  Then press F9 to let the 
program run.  The program should break whenever the variable gets written 
to.  The first time this will happen will probably be when you create the 
global instance.  Just press F9 again and then see if it breaks again - 
which should be the place where it gets reset to nil.  (Assuming that this 
is indeed the problem.  You need to make sure you've not got duplicate 
variables declared so that another variable of the same name is hiding the 
global, making it look like it's null instead of actually being null.)

Regards

Walter Prins 



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/i7folB/TM
--------------------------------------------------------------------~-> 

-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to