Yes, I got confused too and bit surprised to see why Delphi allowed me to do this :)<br><br>Thanks<br>Ani<br><br><div><span class="gmail_quote">On 7/25/07, <b class="gmail_sendername">Myles Penlington</b> &lt;<a href="mailto:myles@ams.co.nz">
myles@ams.co.nz</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">








<div link="blue" vlink="purple" lang="EN-NZ">

<div>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Yes you can do this. In this case the Self pointer is nil, and
any reference to any property on the from B will give a AV, but if no references
to class instance properties, then in effect you have a class function.</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Is not very good programming. Does not really make sense unless
you want to confuse someone!</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Myles.</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0cm 0cm;">

<p><b><span style="font-size: 10pt;" lang="EN-US">From:</span></b><span style="font-size: 10pt;" lang="EN-US"> <a href="mailto:delphi-bounces@delphi.org.nz" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
delphi-bounces@delphi.org.nz</a>
[mailto:<a href="mailto:delphi-bounces@delphi.org.nz" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">delphi-bounces@delphi.org.nz</a>] <b>On Behalf Of </b>ani chakra<br>
<b>Sent:</b> Wednesday, 25 July 2007 02:58<br>
<b>To:</b> <a href="mailto:delphi@delphi.org.nz" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">delphi@delphi.org.nz</a><br>
<b>Subject:</b> [DUG] basic question</span></p>

</div><div><span class="e" id="q_113fb56eca2dcc87_1">

<p>&nbsp;</p>

<p style="margin-bottom: 12pt;">Hi,<br>
<br>
Is it possible to call a method of a class without creating a object of it,
even if the method is not a class function in Delphi ? I wrote the below code
just to test -<br>
<br>
1. Created a simple form A and a button on it. <br>
2. Created another simple form B, written a procedure in it as -<br>
&nbsp;&nbsp;&nbsp; FormB.Execute;<br>
&nbsp;&nbsp;&nbsp; begin<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ShowMessage(&quot;xyz&quot;);<br>
&nbsp;&nbsp;&nbsp; end;<br>
3. Commented out auto creation of FormB in application.<br>
4. On Button Click in FormA I called the Execute of FormB and it worked
perfectly okay. <br>
<br>
What could be the reason for this? I had the idea that either I need to create
an object before calling any method or I need to declare a class function.<br>
<br>
In the above steps when I am trying to call Show in Execute function of Form B
I got Access violation which is perfectly fine according to the above
statement. <br>
<br>
May be I am missing something simple here, but any pointers will be great. This
was done in D2005 and it&#39;s win32 app.<br>
<br>
Thanks<br>
-Ani</p></span></div>

</div>


<font face="Verdana" size="1">Attention:<br>This communication is confidential 
and may be legally privileged.&nbsp; If you are not the intended recipient, 
please do not use, disclose, copy or distribute it, other than to return it to 
us with your confirmation that it has been deleted from your 
system.<br></font>
</div>


<br>_______________________________________________<br>NZ Borland Developers Group - Delphi mailing list<br>Post: <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:delphi@delphi.org.nz">delphi@delphi.org.nz
</a><br>Admin: <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>Unsubscribe: send an email to 
<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:delphi-request@delphi.org.nz">delphi-request@delphi.org.nz</a> with Subject: unsubscribe<br></blockquote></div><br>