線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:987
推到 Plurk!
推到 Facebook!

@ 的用法??

答題得分者是:eaglewolf
ttring
一般會員


發表:11
回覆:23
積分:16
註冊:2008-11-19

發送簡訊給我
#1 引用回覆 回覆 發表時間:2009-02-19 10:58:46 IP:60.248.xxx.xxx 訂閱
因為會利用 rave 報表產生 html 並會顯示jpg 圖檔
而產生時, 會依單號產生一暫存圖檔的目錄,
但jpg 圖檔的檔名會自動產生, 如 0000.jpg 0001,jpg 個數不定
但為了防止, 使用者重覆產生, 留下舊資料, 使得jpg 一直產生新的
找到了一個檔案目錄操作的副程式, 想在產生前, 將目錄下的檔案全刪掉

http://delphi.ktop.com.tw/board.php?cid=30&fid=67&tid=71428


但裡面有一段
FromDir : String; {From directory}
ToDir : String {To directory}
): Boolean;
var
SHFileOpStruct : TSHFileOpStruct;
FromBuf, ToBuf: Array [0..255] of Char;

StrPCopy(FromBuf, FromDir);
StrPCopy(ToBuf, ToDir);

pFrom := @FromBuf; //<---compiler 時 說不合法的型態 array and char
pTo := @ToBuf;

是那裡沒指定? =.=??
查一本基礎的書, 並沒寫到 @ 的用法 =.=||
我的版本是 delphi 7 XP

麻煩各位大大 救救我這半路出家的吧
eaglewolf
資深會員


發表:4
回覆:268
積分:429
註冊:2006-07-06

發送簡訊給我
#2 引用回覆 回覆 發表時間:2009-02-19 16:20:16 IP:211.75.xxx.xxx 訂閱
改成以下的方式試試
{$T-}
pFrom := @FromBuf;
pTo := @ToBuf;
{$T }
===================引 用 ttring 文 章===================
因為會利用 rave 報表產生 html 並會顯示jpg 圖檔
而產生時, 會依單號產生一暫存圖檔的目錄,
但jpg 圖檔的檔名會自動產生, 如 0000.jpg 0001,jpg 個數不定
但為了防止, 使用者重覆產生, 留下舊資料, 使得jpg 一直產生新的
找到了一個檔案目錄操作的副程式, 想在產生前, 將目錄下的檔案全刪掉

http://delphi.ktop.com.tw/board.php?cid=30&fid=67&tid=71428


但裡面有一段
FromDir : String; {From directory}
ToDir : String {To directory}
): Boolean;
var
SHFileOpStruct : TSHFileOpStruct;
FromBuf, ToBuf: Array [0..255] of Char;

StrPCopy(FromBuf, FromDir);
StrPCopy(ToBuf, ToDir);

pFrom := @FromBuf; //<---compiler 時 說不合法的型態 array and char
pTo := @ToBuf;

是那裡沒指定? =.=??
查一本基礎的書, 並沒寫到 @ 的用法 =.=||
我的版本是 delphi 7 XP

麻煩各位大大 救救我這半路出家的吧
------
先查HELP
再查GOOGLE
最後才發問

沒人有義務替你解答問題
在標題或文章中標明很急
並不會增加網友回答速度

Developing Tool:
1.Delphi 6
2.Visual Studio 2005
3.Visual Studio 2008
DBMS:
MS-SQL
編輯記錄
eaglewolf 重新編輯於 2009-02-20 09:01:30, 註解 無‧
ttring
一般會員


發表:11
回覆:23
積分:16
註冊:2008-11-19

發送簡訊給我
#3 引用回覆 回覆 發表時間:2009-02-19 16:24:35 IP:60.248.xxx.xxx 訂閱
@@??
剛試不行....大括號不是註解嗎 ?


===================引 用 eaglewolf 文 章===================
改成以下的方式試試
{T$-}
pFrom := @FromBuf;
pTo := @ToBuf;
{T$ }
===================引 用 ttring 文 章===================
因為會利用 rave 報表產生 html 並會顯示jpg 圖檔
而產生時, 會依單號產生一暫存圖檔的目錄,
但jpg 圖檔的檔名會自動產生, 如 0000.jpg 0001,jpg 個數不定
但為了防止, 使用者重覆產生, 留下舊資料, 使得jpg 一直產生新的
找到了一個檔案目錄操作的副程式, 想在產生前, 將目錄下的檔案全刪掉

http://delphi.ktop.com.tw/board.php?cid=30&fid=67&tid=71428


但裡面有一段
FromDir : String; {From directory}
ToDir : String {To directory}
): Boolean;
var
SHFileOpStruct : TSHFileOpStruct;
FromBuf, ToBuf: Array [0..255] of Char;

StrPCopy(FromBuf, FromDir);
StrPCopy(ToBuf, ToDir);

pFrom := @FromBuf; //<---compiler 時 說不合法的型態 array and char
pTo := @ToBuf;

是那裡沒指定? =.=??
查一本基礎的書, 並沒寫到 @ 的用法 =.=||
我的版本是 delphi 7 XP

麻煩各位大大 救救我這半路出家的吧
eaglewolf
資深會員


發表:4
回覆:268
積分:429
註冊:2006-07-06

發送簡訊給我
#4 引用回覆 回覆 發表時間:2009-02-20 09:00:47 IP:211.75.xxx.xxx 訂閱
sorry
是 {$T-} 跟 {$T } 才對

If X is a variable, @X returns the address of X. The type of @X is Pointer if the default {$T-} compiler directive is in effect. In the {$T } state, @X is of type ^T, where T is the type of X.

A comment that contains a dollar sign ($) immediately after the opening { or (* is a compiler directive.

------
先查HELP
再查GOOGLE
最後才發問

沒人有義務替你解答問題
在標題或文章中標明很急
並不會增加網友回答速度

Developing Tool:
1.Delphi 6
2.Visual Studio 2005
3.Visual Studio 2008
DBMS:
MS-SQL
編輯記錄
eaglewolf 重新編輯於 2009-02-20 09:03:50, 註解 無‧
ttring
一般會員


發表:11
回覆:23
積分:16
註冊:2008-11-19

發送簡訊給我
#5 引用回覆 回覆 發表時間:2009-02-20 09:22:27 IP:60.248.xxx.xxx 訂閱

哇, 真的是ya
真是太感謝你了,
解決問題, 又學到了 ^^

===================引 用 eaglewolf 文 章===================
sorry
是 {$T-} 跟 {$T } 才對

If X is a variable, @X returns the address of X. The type of @X is Pointer if the default {$T-} compiler directive is in effect. In the {$T } state, @X is of type ^T, where T is the type of X.

A comment that contains a dollar sign ($) immediately after the opening { or (* is a compiler directive.

系統時間:2024-05-15 20:26:27
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!