Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

DELPHI中有沒有類似C++的靜態變數

0 views
Skip to first unread message

逆天地人而戰

unread,
Apr 2, 1997, 3:00:00 AM4/2/97
to

不知道DELPHI中有沒有STATIC的變數
我所需要的並不是全域變數
而是只能在某一個FUNCTION或者是PROCEDURE使用的靜態變數
謝謝...

--
※ Origin: 元智工學院風之塔 BBS <bbs.yzit.edu.tw> ◆ From: [140.138.251.138]

Roland

unread,
Apr 6, 1997, 4:00:00 AM4/6/97
to

==> 在 Xsh...@cs.nthu.edu.tw (Kuan-Ta Chen) 的文章中提到:
> On 02 Apr 1997 12:03:43 GMT, lo....@bbs.yzit.edu.tw (逆天地人而戰)
> wrote:
> >不知道DELPHI中有沒有STATIC的變數
> >我所需要的並不是全域變數
> >而是只能在某一個FUNCTION或者是PROCEDURE使用的靜態變數
> >謝謝...
> Yeah !! Like this :
> procedure TForm1.Button1Click(Sender: TObject);
> const
> Count: Integer = 0;
^^^^^^^^^^^^ 有意思,Borland 的 Object Pascal
可真是麻雀雖小,....... :-)...
謝謝您的 Information 我會 Try 一下. :-)
--
* Origin: ★ 交通大學資訊科學系 BBS ★ <bbs.cis.nctu.edu.tw: 140.113.23.3>

Kuan-Ta Chen

unread,
Apr 6, 1997, 4:00:00 AM4/6/97
to

On 02 Apr 1997 12:03:43 GMT, lo....@bbs.yzit.edu.tw (逆天地人而戰)
wrote:

>不知道DELPHI中有沒有STATIC的變數
>我所需要的並不是全域變數
>而是只能在某一個FUNCTION或者是PROCEDURE使用的靜態變數
>謝謝...

Yeah !! Like this :

procedure TForm1.Button1Click(Sender: TObject);
const
Count: Integer = 0;

begin
ShowMessage(IntToStr(Count));
Inc(Count);
end;

--
Delphi is based on VCL, which is the Very Cool Library.

E-Mail: Xsh...@cs.nthu.edu.tw
Contact my homepage at http://www.cs.nthu.edu.tw/~br831529

0 new messages